/* =========================================================================
   PREMIUM SPLIT-SCREEN AUTH STYLES
   ========================================================================= */

/* Forged industrial palette: #7FCDFF (ice) / #7FCDFF (sky) */
:root {
  --hue: 205;
  --bg-deep: #0a0a0a;
  --bg-panel: rgba(20, 20, 20, 0.4);

  --primary: #2D9CE5;
  --primary-hover: #55B7F7;
  --primary-glow: rgba(45, 156, 229, 0.35);
  --btn-gradient: linear-gradient(135deg, #55B7F7 0%, #1E85CC 100%);

  --text-main: #f5f5f5;
  --text-muted: #9a9a9a;

  --border: rgba(45, 156, 229, 0.14);
  --border-focus: rgba(45, 156, 229, 0.5);

  --glass-bg: rgba(20, 20, 20, 0.5);
  --glass-border: rgba(45, 156, 229, 0.08);

  --input-bg: rgba(0, 0, 0, 0.2);
  --input-bg-focus: rgba(0, 0, 0, 0.4);
  --input-border-hover: rgba(255, 255, 255, 0.15);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-deep: #f5f5f0;
  --bg-panel: rgba(255, 255, 255, 0.65);

  --primary: #1E85CC;
  --primary-hover: #176FB0;
  --primary-glow: rgba(30, 133, 204, 0.3);
  --btn-gradient: linear-gradient(135deg, #4FB2F0 0%, #1E85CC 100%);

  --text-main: #1a1a1a;
  --text-muted: #7a7a7a;

  --border: rgba(0, 0, 0, 0.14);
  --border-focus: rgba(30, 133, 204, 0.5);

  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(30, 133, 204, 0.15);

  --input-bg: rgba(0, 0, 0, 0.03);
  --input-bg-focus: rgba(255, 255, 255, 0.85);
  --input-border-hover: rgba(0, 0, 0, 0.3);
}

/* --- SCROLLBAR: slim + auto-hiding ---
   Idle: invisible. Scrolling: neutral grey. Hover/drag: brand blue.
   [data-scrolling] is toggled by static/scrollbar-behavior.js. */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
[data-scrolling] ::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.45); }
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active { background: var(--primary); }
html { scrollbar-width: thin; scrollbar-color: transparent transparent; }
html[data-scrolling] { scrollbar-color: rgba(128, 128, 128, 0.45) transparent; }

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

html, body { overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }

body {
  font-family: 'Archivo', 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout: Split Screen --- */
.split-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Visual Side */
.split-visual {
  flex: 1;
  position: relative;
  display: none; /* Hidden on mobile */
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--bg-deep);
}

@media (min-width: 900px) {
  .split-visual {
    display: flex;
  }
}

/* Mobile Premium Background */
@media (max-width: 899px) {
  .split-layout {
    background-image: url('auth_sidebar.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
  }
  .split-layout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(4, 18, 31, 0.85); /* Deep dark overlay to ensure form readability */
    z-index: 0;
  }
  [data-theme="light"] .split-layout::before {
    background: rgba(245, 245, 240, 0.88);
  }
  .split-form-container {
    background: transparent !important;
    z-index: 1;
  }
}

.image-bg {
  position: absolute;
  inset: 0;
  background-image: url('auth_sidebar.jpg');
  background-size: cover;
  background-position: center;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(4, 18, 31, 0.6) 0%, rgba(45, 156, 229, 0.4) 100%);
  mix-blend-mode: overlay;
}

.image-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(4, 18, 31, 0.9) 100%);
}

.visual-branding {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 40px;
}

.visual-title {
  font-family: 'Archivo', 'Plus Jakarta Sans', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(to right, #7FCDFF, #7FCDFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.visual-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* The left visual panel keeps its dark photo treatment in both themes,
   so its caption must stay light even in light mode. */
[data-theme="light"] .visual-subtitle {
  color: rgba(255, 255, 255, 0.82);
}

/* Right Form Side */
.split-form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 20px; /* Reduced from 40px 20px */
  background: var(--bg-panel);
}

.auth-main {
  width: 100%;
  max-width: 440px;
  animation: fadeUp 0.6s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Form Card (Glassmorphism) --- */
.auth-card-wrapper {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px; /* Reduced from 48px */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@media (max-width: 600px) {
  .auth-card-wrapper {
    padding: 24px 16px;
    /* Maintained glass effect for mobile instead of removing it */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
  }
}

.card__head {
  margin-bottom: 20px; /* Reduced from 32px */
  text-align: center;
}

.brand {
  font-family: 'Archivo', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem; /* Reduced from 2rem */
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px; /* Reduced from 8px */
  letter-spacing: -0.02em;
}

.sub {
  color: var(--text-muted);
  font-size: 0.9rem; /* Reduced from 0.95rem */
  font-weight: 500;
}

/* --- Form Elements --- */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Reduced from 20px */
}

.field {
  position: relative;
  width: 100%;
}

.field input {
  width: 100%;
  min-width: 0; /* Prevents input from blowing out of flex/grid containers */
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px 8px 16px; /* Reduced vertical padding */
  color: var(--text-main);
  font-family: 'Archivo', 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem; /* Reduced from 1rem */
  outline: none;
  transition: all 0.3s var(--ease);
}

.field input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  /* Ensure exact same height as other inputs when empty */
  min-height: 50px; 
}

.field input:hover {
  border-color: var(--input-border-hover);
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--input-bg-focus);
}

.field label {
  position: absolute;
  left: 16px;
  top: 14px; /* Adjusted for new padding */
  color: var(--text-muted);
  font-size: 0.95rem; /* Reduced from 1rem */
  pointer-events: none;
  transition: all 0.2s var(--ease);
  transform-origin: left top;
}

/* Floating Label Magic */
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label {
  transform: translateY(-6px) scale(0.75); /* Adjusted from -8px */
  color: var(--primary);
}

.field input:not(:focus):not(:placeholder-shown) ~ label {
  color: var(--text-muted);
}

/* Password Reveal Button */
.reveal {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

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

.reveal svg {
  width: 20px;
  height: 20px;
}

.icon-on { display: none; }
.icon-off { display: block; }

.reveal[aria-pressed="true"] .icon-on { display: block; }
.reveal[aria-pressed="true"] .icon-off { display: none; }

/* --- Row & Checkbox --- */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem; /* Reduced from 0.9rem */
  margin-top: 2px; /* Reduced from 4px */
}

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

.check input {
  display: none;
}

.check__box {
  width: 16px; /* Reduced from 18px */
  height: 16px; /* Reduced from 18px */
  border: 1.5px solid var(--border);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s var(--ease);
}

.check input:checked ~ .check__box {
  background: var(--primary);
  border-color: var(--primary);
}

.check input:checked ~ .check__box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.link:hover {
  color: var(--primary-hover);
}

/* --- Submit Button --- */
.btn {
  width: 100%;
  padding: 14px; /* Reduced from 16px */
  background: var(--btn-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm, 4px);
  font-family: 'Archivo', 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem; /* Reduced from 1.05rem */
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 6px; /* Reduced from 12px */
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.btn:active {
  transform: translateY(0);
}

/* --- Footer Links --- */
.foot {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem; /* Reduced from 0.95rem */
  margin-top: 12px; /* Reduced from 24px */
}

.auth-alerts {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-message {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: fadeUp 0.3s ease;
}

.toast-message.success { background: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.toast-message.error { background: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.toast-message.warning { background: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.toast-message .icon { width: 20px; height: 20px; flex-shrink: 0; }


/* ============================================================
   AUTH DESIGN SYSTEM 2.0 — Ocean Breeze overhaul layer
   ============================================================ */

.brand, .visual-title {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.035em;
}
::selection { background: rgba(45, 156, 229, 0.35); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
* { -webkit-tap-highlight-color: transparent; }

/* Drifting ocean orbs behind the visual panel */
.split-visual::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 22% 30%, rgba(45, 156, 229, 0.18), transparent 26%),
    radial-gradient(circle at 78% 72%, rgba(30, 133, 204, 0.22), transparent 30%),
    radial-gradient(circle at 60% 20%, rgba(223, 247, 255, 0.10), transparent 22%);
  animation: authOrbs 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes authOrbs {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

/* Card: ocean edge glow */
.auth-card-wrapper {
  border-color: rgba(45, 156, 229, 0.14);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 60px -30px rgba(45, 156, 229, 0.35);
}

/* Shine sweep on submit */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-160%) skewX(-20deg);
  transition: transform 0.65s var(--ease);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(240%) skewX(-20deg); }

/* Input lift on focus */
.field input:focus { transform: translateY(-1px); }

@media (pointer: coarse) {
  .btn, .reveal { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
