/* Layout Container */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}

.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  width: 100%;
  min-height: 100vh;
}

/* Form Area (UNTOUCHED) */
.auth-form-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 80px;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}

.auth-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.auth-header p {
  color: var(--text-dim);
  margin-top: 6px;
  margin-bottom: 32px;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Fields & Labels */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.field input {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass-bg-input);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.2s var(--transition-smooth);
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-subtle);
  background: rgba(255, 255, 255, 0.08);
}

/* Centered Forgot Password Button */
.forgot-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.forgot-btn {
  background: none;
  border: none;
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s var(--transition-smooth);
}

.forgot-btn:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* Buttons & Alerts */
.btn-primary {
  padding: 13px;
  margin-top: 6px;
  background: var(--primary);
  border: 1px solid var(--primary-subtle-border);
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--glow-primary);
}

.btn-primary:active {
  transform: scale(0.99);
}

.alert {
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  text-align: center;
  font-weight: 500;
}

.alert-error {
  background: var(--error-subtle);
  border: 1px solid var(--error-subtle-border);
  color: var(--error-text);
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--success-text);
}

.error {
  color: var(--error-text);
  font-size: 12px;
  font-weight: 500;
}

/* Right Platform Showcase Column (REDESIGNED) */
.auth-showcase {
  position: relative;
  background: var(--surface-card-alt);
  border-left: 1px solid var(--glass-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
}

.showcase-glow {
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(70px);
  opacity: 0.35;
}

.showcase-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
  width: 100%;
}

.feature-badge {
  display: inline-block;
  padding: 5px 12px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-subtle-border);
  color: var(--primary-text);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.showcase-content h2 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--text-main);
}

.showcase-content p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 28px;
}

/* Stage & Floating Mockup */
.showcase-stage {
  position: relative;
  width: 100%;
  height: 280px;
  perspective: 1000px;
}

.stage-bg-image {
  width: 100%;
  height: 230px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border-light);
  box-shadow: var(--shadow-xl);
  transform: rotate(-2deg) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
}

.stage-window-hint {
  position: absolute;
  bottom: 0;
  right: -10px;
  width: 92%;
  background: rgba(15, 16, 21, 0.94);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  backdrop-filter: var(--glass-blur-heavy);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
  transform: rotate(2deg) translateY(0);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-showcase:hover .stage-window-hint {
  transform: rotate(0deg) translateY(-6px);
}

.auth-showcase:hover .stage-bg-image {
  transform: rotate(0deg) scale(1);
}

.window-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--glass-border-subtle);
}

.window-dot { width: 8px; height: 8px; border-radius: 50%; }
.window-dot.red { background: #ef4444; }
.window-dot.yellow { background: #eab308; }
.window-dot.green { background: #22c55e; }

.window-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.window-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.preview-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}

.preview-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
}

.chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-subtle-border);
  color: var(--primary-text-light);
  font-weight: 600;
}

/* Toast Component Styles */
.toast-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--transition-smooth);
  z-index: 100;
}

.toast-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.toast-card {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: var(--surface-card);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  z-index: 101;
  transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .toast-card {
    border-radius: var(--radius-xl);
    bottom: -100%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--transition-smooth), opacity 0.25s var(--transition-smooth);
  }

  .toast-card.active {
    bottom: auto;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
}

.toast-card.active {
  bottom: 0;
}

.toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.toast-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.toast-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text-main);
}

.toast-card p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.toast-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 960px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
  }
  .auth-showcase {
    display: none;
  }
  .auth-form-container {
    padding: 32px 20px;
  }
  .field input {
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }
}
/* Authentication pages: shared layout, hierarchy and accessible controls. */
.auth-page {
  margin: 0;
  background: var(--surface-base, #0d111b);
  color: var(--text-main, #f1f5f9);
  font-family: var(--font-sans, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  line-height: 1.6;
}
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }
.auth-page .auth-form-container { padding: clamp(28px, 5vw, 72px) clamp(24px, 4vw, 56px); }
.auth-page .auth-header { margin-bottom: 28px; }
.auth-page .auth-header h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--text-main, #f1f5f9);
}
.auth-page .auth-header p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--text-dim, #b3bdcf); }
.auth-page .auth-eyebrow {
  display: block;
  margin-bottom: 14px;
  color: var(--primary-text, #b6b9ff);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.auth-page .field { min-width: 0; gap: 7px; }
.auth-page .field label { color: var(--text-main, #f1f5f9); font-size: 14px; font-weight: 600; }
.auth-page .field label span { font-weight: 400; color: var(--text-dim, #b3bdcf); font-size: 12px; }
.auth-page .field input {
  min-height: 48px;
  font: inherit;
  font-size: 16px;
  background: var(--glass-bg-input, #141b2a);
  border: 1px solid var(--glass-border-light, #3c475d);
  border-radius: var(--radius-md, 10px);
  color: var(--text-main, #f1f5f9);
}
.auth-page .field input:focus { border-color: var(--primary, #818cf8); }
.auth-page .field input::placeholder { color: var(--text-dim, #aab4c6); opacity: .85; }
.auth-page .field-help, .auth-page .auth-help {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim, #b3bdcf);
}
.auth-page .auth-help { text-align: center; }
.auth-page .btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  margin: 0;
  border-radius: var(--radius-md, 10px);
  background: var(--primary, #4f46e5);
  border: 1px solid var(--primary-subtle-border, #7770ed);
  font-size: 15px;
  font-weight: 650;
}
.auth-page .btn-primary:hover { background: var(--primary-hover, #4338ca); }
.auth-page a {
  color: var(--primary-text, #b6b9ff);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.auth-page a:hover { color: var(--text-main, #fff); text-decoration-thickness: 2px; }
.auth-page :is(a, button, input):focus-visible { outline: 3px solid var(--primary-text, #b6b9ff); outline-offset: 4px; }
.auth-page .auth-actions { display: grid; gap: 12px; margin-top: 6px; }
.auth-page .auth-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--glass-border-light, #3c475d);
  border-radius: var(--radius-md, 10px);
  background: transparent;
  text-align: center;
}
.auth-page .auth-footer { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--glass-border-light, #3c475d); text-align: center; }
.auth-page .auth-note { padding: 16px 18px; margin-bottom: 24px; border: 1px solid var(--glass-border-light, #3c475d); border-radius: 12px; background: var(--glass-bg-input, #141b2a); }
.auth-page .auth-note h2 { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.auth-page .auth-note ul { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-dim, #b3bdcf); }
.auth-page .alert { margin: 0 0 20px; padding: 14px 16px; border-radius: 10px; text-align: left; line-height: 1.6; }
.auth-page .login-form > .alert { margin-bottom: 0; }
.auth-page .alert-error { background: var(--error-subtle, #351c28); border: 1px solid var(--error-subtle-border, #8d4058); color: var(--error-text, #ffc4ce); }
.auth-page .alert-success { background: var(--success-bg, #102b25); border: 1px solid #2f7863; color: var(--success-text, #b2ecd5); }
.auth-page .alert h2 { font-size: 17px; margin: 0 0 12px; }
.auth-page .alert p { margin: 12px 0 0; }
.auth-page .credential-summary { margin: 0; display: grid; gap: 12px; }
.auth-page .credential-summary dt { font-size: 12px; font-weight: 600; }
.auth-page .credential-summary dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.auth-page .credential-summary code { display: block; padding: 10px 12px; color: inherit; background: rgba(0,0,0,.18); border: 1px solid rgba(127,170,153,.4); border-radius: 7px; font-size: 16px; user-select: all; }
.auth-page .form-section { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 18px; }
.auth-page .form-section legend { padding: 0; margin-bottom: 14px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim, #b3bdcf); }
.auth-page .form-section + .form-section { padding-top: 24px; border-top: 1px solid var(--glass-border-light, #3c475d); }
.auth-page .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Single-task pages get a centred card, not the login's two-column grid. */
.auth-page.auth-page--compact { padding: clamp(20px, 4vw, 48px) 16px; min-height: 100vh; min-height: 100svh; }
.auth-page--compact .auth-wrapper { display: block; width: 100%; max-width: 560px; min-height: 0; }
.auth-page--compact .auth-form-container {
  max-width: none;
  padding: clamp(24px, 5vw, 44px);
  background: var(--surface-card, #141a27);
  border: 1px solid var(--glass-border-light, #3c475d);
  border-radius: 20px;
  box-shadow: 0 20px 64px rgba(0, 0, 0, .22);
}
.auth-page--compact .auth-header { text-align: center; }
@media (max-width: 960px) {
  .auth-page:not(.auth-page--compact) .auth-wrapper { min-height: 100vh; min-height: 100svh; }
  .auth-page:not(.auth-page--compact) .auth-header { text-align: center; }
}
@media (max-width: 480px) {
  .auth-page .form-row { grid-template-columns: 1fr; }
  .auth-page--compact .auth-form-container { padding: 26px 20px; border-radius: 16px; }
  .auth-page .auth-note ul { display: block; }
  .auth-page .auth-note li + li { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { transition: none !important; animation: none !important; }
}
