:root {
  color-scheme: dark;
  --bg: #050505;
  --line: #1c1c1c;
  --text: #f0ece4;
  --muted: #888;
  --dim: #444;
  --accent: #F5C842;
  --accent-strong: #D4A017;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: soft-light;
  z-index: 0;
}

/* ===== SPLIT PANEL ===== */
.panel {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  z-index: 1;
}

/* LEFT — cover art full bleed */
.left {
  position: relative;
  overflow: hidden;
  background: #000;
}

.left-bg {
  position: absolute;
  inset: 0;
  background-image: url("https://trackport.store/wp-content/uploads/albums/TRACKPORT-01---3AM.webp");
  background-size: cover;
  background-position: center;
  filter: brightness(0.45) saturate(0.8);
  transition: transform 8s ease;
}

.left:hover .left-bg {
  transform: scale(1.04);
}

.left-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.7) 100%),
    linear-gradient(90deg, rgba(0,0,0,0) 60%, rgba(5,5,5,0.9) 100%);
}

.left-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 44px;
}

.brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
  text-decoration: none;
}

.brand span { color: var(--accent); }

.left-bottom {}

.left-tagline {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.left-tagline em {
  font-style: normal;
  color: var(--accent);
}

.left-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.2px;
  line-height: 1.5;
}

/* RIGHT — form */
.right {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 56px;
  position: relative;
  border-left: 1px solid var(--line);
}

.right > * {
  width: 100%;
  max-width: 360px;
}

.card-brand {
  display: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.card-brand span { color: var(--accent); }

.form-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.form-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.5;
}

/* ===== FORM ===== */
.auth-form {
  display: grid;
  gap: 28px;
}

.field {
  display: grid;
  gap: 10px;
}

.field span,
.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--dim);
}

.field input {
  width: 100%;
  height: 52px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  color: var(--text);
  padding: 0 8px 0 10px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 400;
  transition: border-color 0.2s;
  border-radius: 4px;
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.field input::placeholder {
  color: #333;
}

/* ===== INPUT WRAP (password toggle) ===== */
.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 40px;
}

.pw-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.pw-toggle:hover { color: var(--muted); }

/* ===== PRIMARY BUTTON ===== */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border: 1px solid var(--accent-strong);
  border-radius: 0;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
  transition: background 0.2s, color 0.2s;
  margin-top: 8px;
}

.primary:hover {
  background: var(--accent);
  color: #000;
}

.primary .btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(212,160,23,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s, transform 0.2s;
  animation: spin 0.8s linear infinite;
}

.primary.loading {
  pointer-events: none;
  opacity: 0.8;
}

.primary.loading .btn-spinner {
  opacity: 1;
  transform: scale(1);
}

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

/* ===== SECONDARY BUTTON ===== */
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: 1px solid var(--dim);
  border-radius: 0;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  margin-top: 12px;
}

.secondary:hover {
  border-color: #555;
  color: var(--text);
}

/* ===== LINKS ===== */
.auth-links {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.auth-links a {
  color: var(--dim);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-links a:hover { color: var(--accent); }

/* ===== FOOTER ===== */
.auth-foot {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.support-link {
  color: var(--dim);
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s;
}

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

/* ===== NOTICE ===== */
.notice {
  background: rgba(21,128,61,0.12);
  border: 1px solid rgba(34,197,94,0.2);
  color: #86efac;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  border-radius: 0;
}

/* ===== SUCCESS TOAST ===== */
.success-toast {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, #15803d, #22c55e);
  color: #fff;
  padding: 12px 24px;
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(34,197,94,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
  letter-spacing: 0.3px;
}

.success-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.success-toast svg { flex-shrink: 0; }

/* ===== LANGUAGE SWITCH ===== */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
}

.lang-trigger:hover {
  border-color: #2a2a2a;
  color: var(--muted);
}

.lang-trigger svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.lang-menu {
  position: absolute;
  left: 0;
  bottom: 38px;
  min-width: 200px;
  padding: 6px;
  background: #0d0d0d;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  display: none;
  z-index: 50;
}

.lang-menu.open { display: block; }

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
  background: #111;
  color: #fff;
}

.lang-option.active {
  color: var(--accent);
}

.lang-flag {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  display: inline-flex;
  flex: 0 0 24px;
}

.lang-flag svg {
  width: 24px;
  height: 16px;
  display: block;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.hidden { display: none; }

/* ===== CENTERED CARD (forgot, reset, etc) ===== */
.wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: min(480px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 48px 40px;
}

.auth-card .brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: block;
  text-align: center;
}

.auth-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .panel {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .left { display: none; }

  .right {
    padding: 48px 32px;
    justify-content: flex-start;
    padding-top: 64px;
    border-left: none;
  }

  .card-brand { display: block; text-align: center; }
}

@media (max-width: 480px) {
  .right { padding: 48px 24px; }
  .auth-card { padding: 32px 24px; }
}
