/* ============================================================
   Opnclo — Shared Design System
   Loaded by all admin/auth/onboarding pages.
   Page-specific styles stay inline in each HTML file.
   ============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f4f7f5;
  --bg-dark: #0C0F0A;
  --bg-card: #F2F1ED;
  --text: #1A1D17;
  --text-muted: #6B7060;
  --text-light: #9CA38F;
  --accent: #40916C;
  --accent-light: #40916C;
  --accent-glow: #5aab86;
  --white: #f4f7f5;
  --border: #E0DED6;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== BASE BODY ===== */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== LOGO ===== */
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo img {
  height: 40px;
  width: auto;
  display: block;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-body);
  margin-right: 8px;
}

/* ===== NAVBAR — Onboarding / Auth variant (sticky, 64px) ===== */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input::placeholder {
  color: #B0B0A8;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.08);
}

/* ===== ONBOARDING PROGRESS BAR ===== */
.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
}
.onboarding-progress .step {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.onboarding-progress .step.done {
  background: var(--accent);
}
.onboarding-progress .step.active {
  background: var(--accent);
  width: 48px;
}
.onboarding-progress .step-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 8px;
  white-space: nowrap;
}

/* ===== ONBOARDING LAYOUT ===== */
.onboarding-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}
.onboarding-card {
  width: 100%;
  max-width: 520px;
}
.onboarding-card h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.2;
}
.onboarding-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ===== AUTH LAYOUT (login/signup) ===== */
.auth-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 64px);
}
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}
.auth-form-container {
  width: 100%;
  max-width: 440px;
}
.auth-form-container h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  margin-bottom: 36px;
  line-height: 1.2;
}

/* ===== COMMON BUTTONS ===== */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 4px;
}
.btn-submit:hover:not(:disabled) {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45,106,79,0.25);
}
.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-create {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 32px;
}
.btn-create:hover:not(:disabled) {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45,106,79,0.25);
}
.btn-create:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-back {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  text-align: center;
}
.btn-back:hover {
  color: var(--text);
}

/* ===== NAV RIGHT (auth pages) ===== */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}
.nav-right a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-right a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== AUTH SWITCH & FOOTER ===== */
.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover {
  text-decoration: underline;
}
.auth-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.auth-footer a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-footer a:hover { color: var(--accent); }

/* ===== GOOGLE BUTTON ===== */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-google:hover {
  border-color: #c4c4c4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.btn-google svg { flex-shrink: 0; }

/* ===== DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== PASSWORD TOGGLE ===== */
.password-wrapper {
  position: relative;
}
.password-wrapper input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
}
.password-toggle:hover { color: var(--text); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success {
  background: #e8f5ee;
  color: #2D6A4F;
  border: 1px solid #c6e6d5;
}
.toast.error {
  background: #fde8e8;
  color: #9b1c1c;
  border: 1px solid #f8b4b4;
}

/* ===== RESPONSIVE — Base ===== */
@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-preview-side {
    display: none;
  }
}
@media (max-width: 600px) {
  .onboarding-wrapper { padding: 32px 20px; }
  .onboarding-card h1 { font-size: 28px; }
  .auth-form-side { padding: 32px 20px; }
  .auth-form-container h1 { font-size: 28px; }
  .nav-inner { padding: 0 20px; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
