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

:root {
  --slate-dark:  #2D3748;
  --slate:       #4A5568;
  --slate-light: #EDF2F7;
  --sage:        #5C7A5C;
  --sage-light:  #E8F0E8;
  --rose:        #8B5E6B;
  --rose-light:  #F5E6EC;
  --bg:          #FAFAF8;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--slate-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ──────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 62px;
  background: rgba(250,250,248,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 32px;
  z-index: 100;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot {
  width: 8px; height: 8px;
  background: var(--sage);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Page layout ─────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 16px 40px;
}

.card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.subtitle {
  color: var(--slate);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ── Tabs ────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  background: var(--slate-light);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
  position: relative;
}
.tab-indicator {
  position: absolute;
  top: 4px; height: calc(100% - 8px);
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: left 0.22s cubic-bezier(0.4,0,0.2,1), width 0.22s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none; z-index: 0;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: color 0.2s, transform 0.12s;
  position: relative; z-index: 1;
}
.tab-btn.active { color: var(--slate-dark); }
.tab-btn:active { transform: scale(0.97); }

/* ── Form ────────────────────────────────────────────── */
.form-panel { display: none; }
.form-panel.active { display: block; }

.field {
  margin-bottom: 16px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 6px;
}
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--slate-light);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--slate-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
input:focus {
  border-color: var(--sage);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--slate-dark);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 8px;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.error-msg {
  background: var(--rose-light);
  color: var(--rose);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

.success-msg {
  background: var(--sage-light);
  color: var(--sage);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

.link-btn {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: 13px;
  color: var(--sage); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { opacity: 0.75; }

.back-link {
  display: inline-block; margin-top: 16px;
  font-size: 13px; color: var(--slate);
  cursor: pointer; background: none; border: none;
  font-family: inherit; text-decoration: underline;
  text-underline-offset: 2px;
}
.back-link:hover { color: var(--slate-dark); }

.code-input {
  text-align: center;
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: 10px;
}

/* ── Toast ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--slate-dark);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  animation: slideIn 0.3s ease;
}
.toast.success { background: var(--sage); }
.toast.error   { background: var(--rose); }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
