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

:root {
  --dark:   #0d1b2a;
  --accent: #0d6efd;
  --green:  #16a34a;
  --red:    #dc2626;
  --bg:     #f1f5f9;
  --card:   #ffffff;
  --border: #e2e8f0;
  --text:   #1e293b;
  --muted:  #64748b;
}

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

header {
  background: var(--dark);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
header .logo { font-size: 1.3rem; font-weight: 700; }
header .tagline { margin-left: auto; font-size: 0.8rem; color: #94a3b8; }

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.tab-switcher {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
}

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

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}
.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.12);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.password-field input[type="password"] {
  margin-bottom: 0;
  padding-right: 40px;
}
.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.toggle-password:hover {
  opacity: 0.9;
}

.field-hint {
  font-weight: 400;
  color: var(--muted);
}

.tos-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.tos-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.tos-label {
  font-weight: 400 !important;
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.tos-row a { color: var(--accent); text-decoration: none; }
.tos-row a:hover { text-decoration: underline; }

.benefits-inline {
  background: #f0f7ff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text);
}
.benefit-inline {
  padding: 4px 0;
}

.btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  display: inline-block;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-secondary { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-secondary:hover:not(:disabled) { background: #f0f7ff; }

.error-box {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: var(--red);
  font-size: 0.85rem;
  padding: 10px 12px;
  margin-bottom: 16px;
  display: none;
}
.error-box.visible { display: block; }

.success-box {
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: var(--green);
  font-size: 0.85rem;
  padding: 10px 12px;
  margin-bottom: 16px;
  display: none;
}
.success-box.visible { display: block; }

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 18px;
  text-align: center;
}
.hint a { color: var(--accent); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

.divider {
  height: 1px;
  background: var(--border);
  width: 100%;
}

.signup-prompt {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 10px;
}

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer {
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--muted);
}
footer a { color: var(--muted); }
