/* ==============================================================================
   CLASSFLOW / STUDYO - AUTHENTICATION DESIGN SYSTEM
   Pixel-perfect Apple/VisionOS Glassmorphic Dark Design with Iridescent Ribbon
   ============================================================================== */

:root {
  --bg-dark: #05070c;
  --card-bg: rgba(22, 26, 36, 0.62);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-border-top: rgba(255, 255, 255, 0.22);
  --card-shadow: 0 35px 100px -15px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-bg-focus: rgba(255, 255, 255, 0.09);
  --input-border: rgba(255, 255, 255, 0.09);
  --input-border-focus: rgba(255, 255, 255, 0.35);
  --input-text: #ffffff;
  --input-placeholder: rgba(255, 255, 255, 0.32);

  --btn-primary-bg: #ffffff;
  --btn-primary-text: #080a0f;
  --btn-primary-hover: #f1f3f9;
  
  --social-btn-bg: rgba(255, 255, 255, 0.05);
  --social-btn-border: rgba(255, 255, 255, 0.1);
  --social-btn-hover: rgba(255, 255, 255, 0.11);
  --social-btn-hover-border: rgba(255, 255, 255, 0.25);

  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-dim: rgba(255, 255, 255, 0.35);

  --pill-bg: rgba(0, 0, 0, 0.45);
  --pill-active-bg: rgba(255, 255, 255, 0.15);
  --pill-border: rgba(255, 255, 255, 0.08);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
   BACKGROUND: IRIDESCENT FLUID RIBBON & GLOWING AURORA
   ============================================================================== */
.auth-ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 80% 30%, rgba(26, 42, 77, 0.25) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(13, 30, 60, 0.4) 0%, transparent 70%),
              #05070c;
}

/* Dynamic SVG Iridescent Wave */
.aurora-ribbon-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
  filter: drop-shadow(0 0 50px rgba(0, 140, 255, 0.35));
  animation: ribbonPulse 16s ease-in-out infinite alternate;
}

@keyframes ribbonPulse {
  0% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 50px rgba(0, 140, 255, 0.3)); }
  50% { transform: scale(1.03) translateY(-10px); filter: drop-shadow(0 0 70px rgba(80, 170, 255, 0.45)); }
  100% { transform: scale(0.98) translateY(12px); filter: drop-shadow(0 0 45px rgba(140, 90, 255, 0.35)); }
}

/* Ambient glow blobs */
.glow-orb-blue {
  position: absolute;
  bottom: -15%;
  left: -10%;
  width: 70vw;
  height: 60vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.5) 0%, rgba(0, 60, 180, 0.2) 45%, transparent 70%);
  filter: blur(80px);
  opacity: 0.75;
  pointer-events: none;
}

.glow-orb-top {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 60vw;
  height: 60vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.15) 0%, rgba(192, 132, 252, 0.2) 40%, rgba(56, 189, 248, 0.15) 60%, transparent 80%);
  filter: blur(70px);
  opacity: 0.85;
  pointer-events: none;
}

/* ==============================================================================
   AUTH CARD WRAPPER & GLASS CONTAINER
   ============================================================================== */
.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  margin: auto;
  animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(45px) saturate(190%);
  -webkit-backdrop-filter: blur(45px) saturate(190%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  border-top: 1px solid var(--card-border-top);
  box-shadow: var(--card-shadow), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
  padding: 30px 32px 28px 32px;
  position: relative;
  overflow: hidden;
}

/* Subtle glass surface light sheen */
.auth-glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

/* ==============================================================================
   TOP BAR: SEGMENTED PILL SWITCHER & CLOSE BUTTON
   ============================================================================== */
.auth-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

/* Segmented pill switcher */
.auth-segmented-pill {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: var(--radius-full);
  padding: 3px;
  display: inline-flex;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.pill-tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.48);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  user-select: none;
  position: relative;
  z-index: 1;
}

.pill-tab:hover:not(.active) {
  color: rgba(255, 255, 255, 0.85);
}

.pill-tab.active {
  background: var(--pill-active-bg);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Close button */
.btn-auth-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  text-decoration: none;
}

.btn-auth-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.btn-auth-close:active {
  transform: scale(0.96);
}

/* ==============================================================================
   BRAND LOGO
   ============================================================================== */
.auth-brand-logo {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.auth-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 136, 255, 0.45));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand-logo:hover .auth-logo-img {
  transform: scale(1.06) rotate(-2deg);
}

/* ==============================================================================
   TITLE & SUBTITLE
   ============================================================================== */
.auth-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 20px;
  line-height: 1.25;
  transition: all 0.2s ease;
}

/* ==============================================================================
   ALERT BANNER (MESSAGES / ERRORS)
   ============================================================================== */
.auth-alert-box {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.35;
  margin-bottom: 18px;
  animation: alertFadeIn 0.25s ease-out;
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-alert-box.error {
  display: flex;
  background: rgba(235, 59, 90, 0.12);
  border: 1px solid rgba(235, 59, 90, 0.3);
  color: #ff768b;
}

.auth-alert-box.success {
  display: flex;
  background: rgba(32, 191, 107, 0.12);
  border: 1px solid rgba(32, 191, 107, 0.3);
  color: #2ed573;
}

.auth-alert-icon {
  flex-shrink: 0;
}

/* ==============================================================================
   FORM ELEMENTS & INPUTS
   ============================================================================== */
.auth-form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* Grid for Two-column inputs (First Name / Last Name) */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input-field {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--input-text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 13px 14px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auth-input-field.has-left-icon {
  padding-left: 42px;
}

.auth-input-field.has-right-icon {
  padding-right: 42px;
}

.auth-input-field::placeholder {
  color: var(--input-placeholder);
  font-weight: 400;
}

.auth-input-field:focus {
  background: var(--input-bg-focus);
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Input Left / Right Icons */
.input-icon-left {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.input-icon-right {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease;
  outline: none;
}

.input-icon-right:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Extra options (Remember me / Forgot password) */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
  margin-bottom: 2px;
  font-size: 0.8rem;
}

.custom-checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text-muted);
}

.custom-checkbox-container input {
  accent-color: #ffffff;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.auth-text-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.auth-text-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Password Strength Indicator */
.password-strength-bar-wrap {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.strength-bar-dot {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  transition: background 0.3s ease;
}

.strength-bar-dot.weak { background: #eb3b5a; }
.strength-bar-dot.fair { background: #fa8231; }
.strength-bar-dot.good { background: #f7b731; }
.strength-bar-dot.strong { background: #20bf6b; }

/* ==============================================================================
   PRIMARY SUBMIT BUTTON (Crisp Solid White)
   ============================================================================== */
.btn-primary-action {
  width: 100%;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.12);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  margin-bottom: 22px;
}

.btn-primary-action:hover {
  background: var(--btn-primary-hover);
  box-shadow: 0 8px 26px rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.btn-primary-action:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.btn-primary-action:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner inside submit button */
.btn-action-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(8, 10, 15, 0.3);
  border-top-color: #080a0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==============================================================================
   DIVIDER: "OR SIGN IN WITH"
   ============================================================================== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider-text {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ==============================================================================
   SOCIAL AUTH BUTTONS (GOOGLE & APPLE)
   ============================================================================== */
.auth-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

.btn-social-auth {
  background: var(--social-btn-bg);
  border: 1px solid var(--social-btn-border);
  border-radius: var(--radius-md);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.btn-social-auth:hover {
  background: var(--social-btn-hover);
  border-color: var(--social-btn-hover-border);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-social-auth:active {
  transform: translateY(1px);
}

/* ==============================================================================
   FOOTER TERMS & SERVICE
   ============================================================================== */
.auth-terms-footer {
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.auth-terms-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.auth-terms-footer a:hover {
  color: #ffffff;
}

/* ==============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================== */
@media (max-width: 480px) {
  .auth-glass-card {
    padding: 24px 20px 22px 20px;
    border-radius: 22px;
  }
  
  .form-row-2col {
    grid-template-columns: 1fr;
  }
  
  .auth-title {
    font-size: 1.3rem;
  }
}
