/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --card:        #161b22;
  --input-bg:    #21262d;
  --border:      #30363d;
  --border-focus:#58a6ff;
  --accent:      #58a6ff;
  --accent-hover:#79b8ff;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --error:       #f85149;
  --success:     #56d364;
  --warn:        #e3b341;
  --radius:      10px;
  --transition:  0.2s ease;
}

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

/* Subtle grid texture behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.15;
  pointer-events: none;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

/* ── Logo / header ───────────────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-accent {
  color: #5b8dee;
}

.tagline {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

/* ── Tab switcher ────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  background: var(--input-bg);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 1.75rem;
}

.tab-btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.tab-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.tab-btn:hover:not(.active) {
  color: var(--text);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.2s ease;
}

.form-panel.active {
  display: flex;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.3px;
}

input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

input::placeholder { color: var(--muted); opacity: 0.6; }

/* password wrapper for the eye toggle */
.pw-wrapper {
  position: relative;
}

.pw-wrapper input {
  padding-right: 2.5rem;
}

.pw-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem;
  transition: color var(--transition);
}

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

/* ── Password strength bar ───────────────────────────────────────────────── */
.strength-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.strength-bars {
  display: flex;
  gap: 4px;
  height: 4px;
}

.strength-bar {
  flex: 1;
  background: var(--border);
  border-radius: 2px;
  transition: background var(--transition);
}

.strength-bar.weak     { background: var(--error); }
.strength-bar.fair     { background: var(--warn); }
.strength-bar.strong   { background: var(--success); }

.strength-label {
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 1em;
}

.strength-hint {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.8;
}

/* ── Alert messages ──────────────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  font-size: 0.85rem;
  padding: 0.65rem 0.85rem;
  line-height: 1.4;
  display: none;
}

.alert.visible { display: block; }
.alert.error   { background: rgba(248, 81, 73, 0.12); border: 1px solid rgba(248, 81, 73, 0.4); color: var(--error); }
.alert.success { background: rgba(86, 211, 100, 0.12); border: 1px solid rgba(86, 211, 100, 0.4); color: var(--success); }

/* ── Submit button ───────────────────────────────────────────────────────── */
.btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #0d1117;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  transition: background var(--transition), opacity var(--transition);
  width: 100%;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Simple CSS spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13, 17, 23, 0.3);
  border-top-color: #0d1117;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.loading .spinner { display: block; }
.btn.loading .btn-text { opacity: 0.7; }

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

/* ── Forgot password link ────────────────────────────────────────────────── */
.forgot-link-wrap {
  text-align: center;
}

.forgot-link {
  color: var(--accent);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color var(--transition);
}

.forgot-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ── Forgot / reset panel titles ─────────────────────────────────────────── */
.panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.panel-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ── Footer note ─────────────────────────────────────────────────────────── */
.footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1.25rem;
}

/* ── 3-column page layout ────────────────────────────────────────────────── */
.page-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  align-items: stretch;
}

.side-col,
.center-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.side-col {
  flex: 0 0 28%;
  padding: 2rem;
}

.center-col {
  flex: 0 0 44%;
  padding: 1rem;
  border-left:  1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Left illustration ───────────────────────────────────────────────────── */
.illustration {
  max-width: 380px;
  width: 100%;
  opacity: 0.9;
}

/* ── Right branding panel ────────────────────────────────────────────────── */
.brand-block {
  max-width: 260px;
}

.brand-name {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 0.6rem;
}

.brand-tagline {
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.brand-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.brand-features li {
  font-size: 1.1rem;
  color: var(--muted);
  padding-left: 1.25rem;
  position: relative;
}

.brand-features li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #5b8dee;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .side-col {
    display: none;
  }

  .center-col {
    flex: 1;
    width: 100%;
    border: none;
    padding: 2rem 1rem;
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 3rem;
  }

  .logo img {
    max-width: 100% !important;
    height: auto !important;
    margin-left: 0 !important;
  }

  .footer-note a,
  #panel-register label a {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 2rem 1.25rem;
    border-radius: 12px;
  }
}

/* ── Plan badge ───────────────────────────────────────────────────────────── */
.plan-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
  background: rgba(91, 141, 238, 0.15);
  color: #5b8dee;
  border: 1px solid rgba(91, 141, 238, 0.3);
}
