* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --ocean-primary: #0f172a;
  --ocean-secondary: #1e293b;
  --ocean-accent: #0ea5e9;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, sans-serif;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at bottom, #1e293b 0%, #0f172a 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dynamic Ocean Background */
.ocean-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.depth-layer {
  position: absolute;
  width: 120%;
  height: 120%;
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
  opacity: 0.1;
}

.depth-layer:nth-child(1) {
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: 10%;
  left: -10%;
  animation-delay: 0s;
  animation-duration: 25s;
}

.depth-layer:nth-child(2) {
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: 10%;
  right: -10%;
  animation-delay: -8s;
  animation-duration: 30s;
}

.depth-layer:nth-child(3) {
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: 50%;
  left: 30%;
  animation-delay: -15s;
  animation-duration: 35s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(-20px, -30px) rotate(1deg) scale(1.05);
  }
  50% {
    transform: translate(30px, 20px) rotate(-1deg) scale(0.95);
  }
  75% {
    transform: translate(-10px, 40px) rotate(0.5deg) scale(1.02);
  }
}

/* Particle System */
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #0ea5e9;
  border-radius: 50%;
  opacity: 0;
  animation: particle-float 15s linear infinite;
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) translateX(0) scale(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) translateX(100px) scale(1);
  }
}

/* Premium Login Container */
.login-container {
  width: 440px;
  padding: 64px 48px;
  background: var(--glass-bg);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  box-shadow: var(--shadow-premium), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 100;
  position: relative;
  transform: translateY(0);
  animation: containerEntrance 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes containerEntrance {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.login-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 32px;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.02)
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

/* Header Section */
.login-header {
  text-align: center;
  margin-bottom: 25px;
  animation: headerSlide 1.2s cubic-bezier(0.4, 0, 0.2, 1) both 0.2s;
}

@keyframes headerSlide {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-logo {
  width: 170px;
  height: 64px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(2deg);
  }
}

.login-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.4;
}

/* Form Styling */
.login-form {
  animation: formSlide 1.2s cubic-bezier(0.4, 0, 0.2, 1) both 0.4s;
}

@keyframes formSlide {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: 10px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.input-container {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(14, 165, 233, 0.1),
    transparent
  );
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.input-container.focused::before {
  left: 100%;
}

.form-input {
  width: 100%;
  height: 45px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0 24px;
  font-size: 17px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1),
    0 8px 32px rgba(14, 165, 233, 0.15);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.form-input:focus::placeholder {
  color: rgba(255, 255, 255, 0.6);
  transform: translateX(4px);
}

/* Premium Button */
.login-button {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  border: none;
  border-radius: 16px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.3);
}

.login-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(14, 165, 233, 0.4);
  background: linear-gradient(135deg, #0284c7, #0891b2);
}

.login-button:hover::before {
  left: 100%;
}

.login-button:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.loading-spinner {
  display: none;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 12px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Additional Options */
.additional-options {
  text-align: center;
  animation: optionsSlide 1.2s cubic-bezier(0.4, 0, 0.2, 1) both 0.6s;
}

@keyframes optionsSlide {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.forgot-password {
  display: inline-block;
  color: #0ea5e9;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px 24px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.forgot-password::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 12px;
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.forgot-password:hover::before {
  transform: scale(1);
}

.forgot-password:hover {
  color: #0284c7;
  transform: translateY(-1px);
}

/* Success Animation */
.success-check {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 12px;
  position: relative;
  animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-check::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 16px;
}

@keyframes successPop {
  0% {
    transform: scale(0) rotate(-180deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Responsive Design */
@media (max-width: 520px) {
  .login-container {
    width: 90%;
    margin: 0 20px;
    padding: 48px 32px;
  }

  .login-title {
    font-size: 28px;
  }

  .brand-logo {
    width: 40vw;
    height: 8vh;
    font-size: 5vw;
    padding: 3vw;
  }
}

@media (max-height: 700px) {
  .login-container {
    padding: 40px 48px;
  }

  .login-header {
    margin-bottom: 32px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators for accessibility */
.login-button:focus,
.forgot-password:focus {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}
