/* ============================================================
   FishBox — login.css
   Centered card, dual light/dark mode, shake animation
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

/* ── CSS Variables ───────────────────────────────────── */
:root,
[data-theme="light"] {
  --bg-base:        #f0f4f8;
  --bg-surface:     #ffffff;
  --bg-surface-2:   #f7f9fc;
  --border:         #dde3ed;
  --text-primary:   #0d1b2a;
  --text-secondary: #4a6580;
  --text-muted:     #8fa3b8;
  --accent:         #0096c7;
  --accent-hover:   #0077a8;
  --accent-soft:    #e0f4fb;
  --danger:         #ef4444;
  --danger-soft:    #fee2e2;
  --success:        #10b981;
  --success-soft:   #d1fae5;
  --shadow-sm:      0 1px 3px rgba(13,27,42,0.06);
  --shadow-md:      0 4px 20px rgba(13,27,42,0.10);
  --shadow-lg:      0 12px 48px rgba(13,27,42,0.14);
  --shadow-glow:    0 0 0 3px rgba(0,150,199,0.18);
}

[data-theme="dark"] {
  --bg-base:        #080f1a;
  --bg-surface:     #0e1829;
  --bg-surface-2:   #111f33;
  --border:         #1a2d47;
  --text-primary:   #e8f2fc;
  --text-secondary: #7a9fc2;
  --text-muted:     #45657f;
  --accent:         #00b4d8;
  --accent-hover:   #48cae4;
  --accent-soft:    #0a2035;
  --danger:         #f87171;
  --danger-soft:    #2d0a0a;
  --success:        #34d399;
  --success-soft:   #052e16;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.35);
  --shadow-lg:      0 12px 48px rgba(0,0,0,0.5);
  --shadow-glow:    0 0 0 3px rgba(0,180,216,0.25);
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease,
              color 0.2s ease, box-shadow 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

[data-theme="light"] body {
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Login Card ──────────────────────────────────────── */
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
}

/* Theme toggle pinned to top-right of card */
.login-theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

/* ── Brand mark ──────────────────────────────────────── */
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand svg { color: var(--accent); flex-shrink: 0; }

.login-brand-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Heading ─────────────────────────────────────────── */
.login-heading {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ── Form ────────────────────────────────────────────── */
.login-form.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-7px); }
  75%       { transform: translateX(7px); }
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder { color: var(--text-muted); }
input:focus { border-color: var(--accent); box-shadow: var(--shadow-glow); }

/* Password wrapper */
.password-field { position: relative; }
.password-field input { padding-right: 44px; }

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.toggle-password:hover { color: var(--text-primary); }

/* Remember me */
.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0 20px;
  cursor: pointer;
}

.remember-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Submit button */
.login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 150, 199, 0.30);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.login-btn:hover { background: var(--accent-hover); box-shadow: 0 6px 24px rgba(0, 150, 199, 0.40); }
.login-btn:active { transform: scale(0.98); }

/* Alerts */
.login-alert {
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-alert-error   { background: var(--danger-soft);  border: 1px solid var(--danger);  color: var(--danger); }
.login-alert-success { background: var(--success-soft); border: 1px solid var(--success); color: var(--success); }

/* Footer note */
.login-footer-note {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Theme toggle pill (shared) ──────────────────────── */
.toggle-track {
  width: 50px;
  height: 27px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.toggle-thumb {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  position: relative;
}

.theme-toggle.is-dark .toggle-thumb { transform: translateX(23px); }

.toggle-thumb .icon-sun,
.toggle-thumb .icon-moon { width: 12px; height: 12px; color: #fff; position: absolute; transition: opacity 0.2s; }
.toggle-thumb .icon-moon { opacity: 0; }
.theme-toggle.is-dark .toggle-thumb .icon-sun  { opacity: 0; }
.theme-toggle.is-dark .toggle-thumb .icon-moon { opacity: 1; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 16px; align-items: flex-start; padding-top: 40px; }
  .login-card { padding: 32px 20px 28px; border-radius: 16px; }
  .login-heading { font-size: 22px; }
}

  --bg-surface:     #ffffff;
  --bg-surface-2:   #f7f9fc;
  --border:         #dde3ed;
  --text-primary:   #0d1b2a;
  --text-secondary: #4a6580;
  --text-muted:     #8fa3b8;
  --accent:         #0096c7;
  --accent-hover:   #0077a8;
  --accent-soft:    #e0f4fb;
  --danger:         #ef4444;
  --danger-soft:    #fee2e2;
  --success:        #10b981;
  --success-soft:   #d1fae5;
  --shadow-sm:      0 1px 3px rgba(13,27,42,0.06);
  --shadow-md:      0 4px 16px rgba(13,27,42,0.08);
  --shadow-glow:    0 0 0 3px rgba(0,150,199,0.18);
}

[data-theme="dark"] {
  --bg-base:        #080f1a;
  --bg-surface:     #0e1829;
  --bg-surface-2:   #111f33;
  --border:         #1a2d47;
  --text-primary:   #e8f2fc;
  --text-secondary: #7a9fc2;
  --text-muted:     #45657f;
  --accent:         #00b4d8;
  --accent-hover:   #48cae4;
  --accent-soft:    #0a2035;
  --danger:         #f87171;
  --danger-soft:    #2d0a0a;
  --success:        #34d399;
  --success-soft:   #052e16;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 0 3px rgba(0,180,216,0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease,
              color 0.2s ease, box-shadow 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Split Screen Layout ──────────────────────────── */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* Left decorative panel */
.login-left {
  flex: 1;
  background: linear-gradient(135deg, #0096c7 0%, #023e8a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -100px;
  right: -100px;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -80px;
  left: -80px;
}

.login-illustration {
  font-size: 96px;
  animation: float 4s ease-in-out infinite;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.login-features {
  list-style: none;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  margin-bottom: 40px;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.login-features li .feat-icon { font-size: 20px; flex-shrink: 0; }

.login-powered {
  position: absolute;
  bottom: 24px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  z-index: 1;
}

/* Right form panel */
.login-right {
  width: 480px;
  flex-shrink: 0;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
}

.login-topbar {
  position: absolute;
  top: 20px;
  right: 20px;
}

/* Theme Toggle (same as main style.css) */
.theme-toggle { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; }

.toggle-track {
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.toggle-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  position: relative;
}

.theme-toggle.is-dark .toggle-thumb { transform: translateX(24px); }

.toggle-thumb .icon-sun,
.toggle-thumb .icon-moon { width: 13px; height: 13px; color: #fff; position: absolute; transition: opacity 0.2s; }

.toggle-thumb .icon-moon { opacity: 0; }
.theme-toggle.is-dark .toggle-thumb .icon-sun { opacity: 0; }
.theme-toggle.is-dark .toggle-thumb .icon-moon { opacity: 1; }

/* Logo & heading */
.login-logo { font-size: 44px; margin-bottom: 8px; }

.login-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

/* Form */
.login-form { width: 100%; }

.login-form.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder { color: var(--text-muted); }
input:focus { border-color: var(--accent); box-shadow: var(--shadow-glow); }

.form-group { margin-bottom: 16px; }

.password-field {
  position: relative;
}

.password-field input { padding-right: 44px; }

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.toggle-password:hover { color: var(--text-primary); }

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 14px 0 22px;
  cursor: pointer;
}

.remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.login-button {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 150, 199, 0.35);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.login-button:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(0, 150, 199, 0.45);
}

.login-button:active { transform: scale(0.98); }

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

.alert.error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert.success {
  background: var(--success-soft);
  border: 1px solid var(--success);
  color: var(--success);
}

.login-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 24px; }
}
