/* =============================================
   RUTGON – login.css
   Login / Sign Up page styles
   ============================================= */

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

/* ---------- VARIABLES ---------- */
:root {
  --bg-base:        #080d17;
  --bg-dark:        #101622;
  --bg-card:        #111a2e;
  --bg-input:       #192233;
  --bg-input-hover: #202b40;
  --border:         rgba(99, 120, 255, 0.18);
  --border-soft:    rgba(148, 163, 184, 0.2);

  --accent:         #135bec;
  --accent-indigo:  #6366f1;
  --accent-violet:  #8b5cf6;
  --accent-cyan:    #06b6d4;

  --text-primary:   #f1f5ff;
  --text-secondary: #94a3b8;
  --text-muted:     #4a5568;
  --text-white:     #ffffff;

  --gradient:       linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-btn:   linear-gradient(135deg, #135bec 0%, #1d4ed8 100%);

  --icon-success:   #10b981;
  --icon-error:     #ef4444;
  --icon-star:      #f59e0b;
  --icon-logo:      linear-gradient(135deg, #fbbf24, #f59e0b);
  --icon-google:    linear-gradient(135deg, #4285F4, #34A853, #FBBC05, #EA4335);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ---------- HEADER ---------- */
.auth-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 68px;
  background: rgba(16, 22, 34, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-size: 22px;
  background: var(--icon-logo);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.45));
  display: inline-flex;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

.logo-dot { color: var(--accent-indigo); }

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}
.back-link:hover { color: var(--text-primary); }

.back-arrow {
  width: 18px; height: 18px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  display: inline-block;
  transform: rotate(225deg);
  flex-shrink: 0;
}

/* ---------- MAIN LAYOUT ---------- */
.auth-main {
  display: flex;
  height: 100vh;
  padding-top: 68px;
}

/* ---------- LEFT PANE (Branding) ---------- */
.pane-left {
  display: none;
  width: 50%;
  position: relative;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  overflow: hidden;
  background: var(--bg-base);
}

@media (min-width: 1024px) {
  .pane-left { display: flex; }
}

.pane-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(160deg, #080d17 0%, #0f1a35 50%, #080d17 100%);
}

.pane-bg-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99,102,241,0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(6,182,212,0.18) 0%, transparent 55%);
}

.pane-bg-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: radial-gradient(rgba(99,102,241,0.2) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 80%);
  animation: grid-float 8s ease-in-out infinite;
}

@keyframes grid-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* Floating cards */
.float-card {
  position: absolute;
  border-radius: 16px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99,102,241,0.25);
  z-index: 3;
  animation: float-anim 6s ease-in-out infinite;
}

.float-card-1 {
  top: 18%; right: 8%;
  width: 160px;
  padding: 14px 16px;
  background: rgba(17, 26, 46, 0.7);
  animation-delay: 0s;
}

.float-card-2 {
  top: 38%; left: 5%;
  width: 200px;
  padding: 14px 16px;
  background: rgba(17, 26, 46, 0.65);
  animation-delay: -2s;
}

.float-card-3 {
  top: 60%; right: 12%;
  width: 175px;
  padding: 14px 16px;
  background: rgba(17, 26, 46, 0.7);
  animation-delay: -4s;
}

@keyframes float-anim {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-10px) rotate(0.5deg); }
  66%       { transform: translateY(5px) rotate(-0.3deg); }
}

.float-card-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.float-card-val {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.float-card-mini-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.mini-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 5px #10b981;
}

.float-card-sub { font-size: 11px; color: #10b981; font-weight: 600; }

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
  margin-top: 8px;
}

.sp-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--gradient);
  opacity: 0.65;
}

/* Pane content */
.pane-content { position: relative; z-index: 10; max-width: 460px; }

.pane-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.35);
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--accent-indigo);
  filter: drop-shadow(0 4px 12px rgba(99,102,241,0.4));
}

.pane-title {
  font-size: clamp(32px, 3.5vw, 46px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--text-white);
  margin-bottom: 20px;
}

.pane-title .accent { color: var(--accent-indigo); }

.pane-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 380px;
  margin-bottom: 36px;
}

/* Social proof */
.social-proof { display: flex; align-items: center; gap: 16px; }
.avatars { display: flex; align-items: center; }

.av {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
  margin-left: -12px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.2s;
}

.av img { width: 100%; height: 100%; object-fit: cover; }
.av:hover { transform: translateY(-4px) scale(1.1); z-index: 5; }
.av:first-child { margin-left: 0; }

.av-more {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
  background: #1e2d45;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -12px;
}

.proof-text { display: flex; flex-direction: column; gap: 2px; }
.stars {
  color: var(--icon-star);
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.25));
}
.proof-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ---------- RIGHT PANE (Form) ---------- */
.pane-right {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  overflow-y: auto;
  background: var(--bg-dark);
}

@media (min-width: 1024px) {
  .pane-right { width: 50%; }
}

.form-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-header { text-align: center; }
@media (min-width: 1024px) { .form-header { text-align: left; } }

.form-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-white);
  margin-bottom: 6px;
}

.form-subtitle { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* ---------- TABS ---------- */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #1a2332;
  border-radius: 12px;
  padding: 5px;
  gap: 4px;
}

.tab-btn {
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  background: transparent;
  color: var(--text-secondary);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(19, 91, 236, 0.4);
}

.tab-btn:not(.active):hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* ---------- PANELS ---------- */
.panel { display: none; }
.panel.active { display: flex; flex-direction: column; gap: 18px; }

/* ---------- FORM FIELDS ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.field-top { display: flex; justify-content: space-between; align-items: center; }

.forgot-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
.forgot-link:hover { color: #60a5fa; }

.input-wrap { position: relative; display: flex; align-items: center; }

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 16px;
  background: var(--bg-input);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input::placeholder { color: var(--text-muted); }

.input-wrap input:focus {
  border-color: rgba(19, 91, 236, 0.6);
  box-shadow: 0 0 0 3px rgba(19, 91, 236, 0.18);
  background: var(--bg-input-hover);
}

.input-icon {
  position: absolute;
  right: 14px;
  color: var(--accent-indigo);
  font-size: 16px;
  opacity: 0.7;
  pointer-events: none;
  line-height: 1;
  display: flex;
  align-items: center;
}

.toggle-pw {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-indigo);
  opacity: 0.7;
  font-size: 16px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.toggle-pw:hover { color: var(--accent-violet); opacity: 1; }

.spinner-fa { color: #fff; font-size: 14px; }

/* Password strength */
.pw-strength { display: flex; gap: 4px; margin-top: 2px; }

.strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(148,163,184,0.15);
  transition: background 0.3s;
}

.strength-bar.weak   { background: #ef4444; }
.strength-bar.medium { background: #f59e0b; }
.strength-bar.strong { background: #10b981; }

.strength-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Remember me */
.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }

.check-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}

.check-row span { font-size: 13px; color: var(--text-secondary); }

/* ---------- SUBMIT BUTTON ---------- */
.btn-submit {
  width: 100%;
  height: 50px;
  background: var(--gradient-btn);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(19, 91, 236, 0.35);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-submit:hover { box-shadow: 0 6px 28px rgba(19, 91, 236, 0.5); transform: translateY(-1px); }
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: scale(0.98); }

.arrow-icon {
  display: inline-block;
  width: 16px; height: 16px;
  border-top: 2.5px solid #fff;
  border-right: 2.5px solid #fff;
  transform: rotate(45deg);
}

/* ---------- DIVIDER ---------- */
.divider { display: flex; align-items: center; gap: 14px; }

.divider-line { flex: 1; height: 1px; background: rgba(148, 163, 184, 0.15); }

.divider-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- SOCIAL BUTTONS ---------- */
.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease);
}

.social-btn:hover {
  background: var(--bg-input-hover);
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.social-btn i { font-size: 18px; }

.social-btn .fa-google {
  background: var(--icon-google);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.social-btn .fa-github { color: var(--text-primary); }

/* ---------- TERMS ---------- */
.terms { text-align: center; font-size: 12px; color: var(--text-muted); line-height: 1.6; }

.terms a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(148,163,184,0.35);
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.terms a:hover { color: var(--accent); }

/* ---------- TOAST ---------- */
.toast-icon { font-size: 18px; color: var(--icon-success); display: flex; flex-shrink: 0; }
.toast-icon i { filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.4)); }
.toast.hide { animation: toast-out 0.3s ease both; }
.toast-msg { color: var(--text-primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px); }
}

/* ---------- SPINNER ---------- */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Input states */
.input-wrap input.valid   { border-color: rgba(16, 185, 129, 0.5); }
.input-wrap input.invalid { border-color: rgba(239, 68, 68, 0.5); }

.field-error { font-size: 12px; color: #f87171; margin-top: 2px; display: none; }
.field-error.show { display: block; }

/* ---------- THEME TOGGLE BUTTON ---------- */
#theme-toggle-login .fa-sun {
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}
#theme-toggle-login .fa-moon {
  color: #5253cc;
  filter: drop-shadow(0 0 8px rgba(82, 83, 204, 0.4));
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg-dark:        #f5f7ff;
  --bg-card:        #ffffff;
  --bg-input:       #f0f4ff;
  --bg-input-hover: #e8eeff;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-white:     #0f172a;
  --border-soft:    rgba(99,102,241,0.2);
}

[data-theme="light"] body { background: var(--bg-dark); }

[data-theme="light"] .auth-header {
  background: rgba(245, 247, 255, 0.92);
  border-bottom-color: rgba(99,102,241,0.15);
}

[data-theme="light"] .pane-left { background: #eef2ff; }

[data-theme="light"] .pane-bg {
  background: linear-gradient(160deg, #f0f4ff 0%, #e0e7ff 50%, #f0f4ff 100%);
}

[data-theme="light"] .pane-bg-glow {
  background:
    radial-gradient(circle at 20% 30%, rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139,92,246,0.06) 0%, transparent 50%);
}

[data-theme="light"] .pane-bg-grid {
  background-image: radial-gradient(rgba(99,102,241,0.12) 1px, transparent 1px);
}

[data-theme="light"] .float-card {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 10px 25px rgba(99,102,241,0.08);
}

[data-theme="light"] .pane-badge {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.2);
}

[data-theme="light"] .av { border-color: #f5f7ff; }
[data-theme="light"] .av-more { background: #e0e7ff; }

[data-theme="light"] .pane-right { background: var(--bg-card); }

[data-theme="light"] .auth-tabs { background: #f0f4ff; }
[data-theme="light"] .tab-btn:not(.active):hover { background: rgba(0,0,0,0.04); }

[data-theme="light"] .input-wrap input {
  background: var(--bg-input);
  border-color: rgba(99,102,241,0.15);
  color: var(--text-primary);
}

[data-theme="light"] .input-wrap input:focus {
  background: var(--bg-input-hover);
  border-color: var(--accent);
}

[data-theme="light"] .social-btn {
  background: #ffffff;
  border-color: rgba(99,102,241,0.2);
  color: #475569;
}

[data-theme="light"] .social-btn:hover {
  background: #f8faff;
  border-color: rgba(99,102,241,0.4);
}

[data-theme="light"] .divider-line { background: rgba(99,102,241,0.15); }

[data-theme="light"] .toast {
  background: #ffffff;
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 8px 32px rgba(99,102,241,0.12);
}

[data-theme="light"] #theme-toggle-login {
  background: rgba(0,0,0,0.05);
  border-color: rgba(99,102,241,0.2);
  color: #0f172a;
}
