/* ═══════════════════════════════════════════════════════
   GREEN COURAGE GLOBAL — Shared Stylesheet
   Used across all pages
   Fonts loaded via <link> tag in HTML partials — no @import needed here.
═══════════════════════════════════════════════════════ */

:root {
  --forest: #1a2e1e;
  --deep: #0f1c12;
  --moss: #2d4a32;
  --sage: #4a7c54;
  --sage-light: #6a9b74;
  --mint: #a8c5a0;
  --gold: #c9a84c;
  --gold-light: #e8d5a3;
  --cream: #f7f4ee;
  --chalk: #fdfcf9;
  --white: #ffffff;
  --charcoal: #2c2c2c;
  --mid: #6b6b6b;
  --light: #9b9b9b;
  --border: rgba(26,46,30,0.10);
  --border-mid: rgba(26,46,30,0.16);
  --shadow-sm: 0 2px 12px rgba(15,28,18,0.06);
  --shadow: 0 4px 32px rgba(15,28,18,0.10);
  --shadow-lg: 0 16px 64px rgba(15,28,18,0.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--chalk); color: var(--charcoal); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp    { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn    { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn   { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
@keyframes spin      { to { transform:rotate(360deg); } }
@keyframes pulse     { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes checkPop  { 0%{transform:scale(0)} 70%{transform:scale(1.2)} 100%{transform:scale(1)} }
@keyframes slideIn   { from { opacity:0; transform:translateX(-16px); } to { opacity:1; transform:translateX(0); } }

/* ─── AUTH LAYOUT (shared by Login, Register, OTP) ─── */
.auth-page { display:flex; min-height:100vh; }

.auth-left {
  width: 480px; flex-shrink: 0;
  background: var(--forest);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}
.auth-left-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 30%, rgba(74,124,84,0.25), transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(45,74,50,0.3), transparent 50%);
}
.auth-left-grain {
  position: absolute; inset: 0; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; text-decoration:none; }
.auth-logo-mark {
  width: 40px; height: 40px; background: rgba(247,244,238,0.1);
  border: 1px solid rgba(247,244,238,0.2);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.auth-logo-mark svg { width: 22px; height: 22px; fill: var(--gold); }
.auth-logo-name { font-family: 'Cormorant Garamond', serif; font-size: 17px; color: var(--cream); font-weight: 500; line-height: 1.1; }
.auth-logo-name span { display: block; font-size: 10px; font-weight: 300; font-family: 'DM Sans', sans-serif; letter-spacing: 0.1em; color: rgba(247,244,238,0.4); }
.auth-left-content { position: relative; z-index: 1; }
.auth-left-quote { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 300; font-style: italic; color: var(--cream); line-height: 1.4; margin-bottom: 24px; }
.auth-left-quote em { color: var(--gold); font-style: normal; }
.auth-left-sub { font-size: 13px; color: rgba(247,244,238,0.45); line-height: 1.7; }
.auth-left-badges { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.auth-left-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(247,244,238,0.05);
  border: 1px solid rgba(247,244,238,0.08);
  border-radius: 8px;
}
.auth-left-badge svg { width: 15px; height: 15px; stroke: var(--gold); fill: none; stroke-width: 1.5; flex-shrink: 0; }
.auth-left-badge span { font-size: 12.5px; color: rgba(247,244,238,0.5); }

.auth-right {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 48px; background: var(--chalk);
}
.auth-form-wrap { width: 100%; max-width: 420px; }

/* ─── FORMS ─── */
.auth-title { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 400; color: var(--forest); margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: var(--mid); margin-bottom: 32px; line-height: 1.5; }

.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 11px; font-weight: 500; color: var(--charcoal); margin-bottom: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.form-group input, .form-group select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: 8px; font-size: 14px; font-family: 'DM Sans', sans-serif;
  color: var(--charcoal); background: white; transition: all 0.2s; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(74,124,84,0.1); }
.form-group input::placeholder { color: var(--light); }
.form-group .input-hint { font-size: 11.5px; color: var(--light); margin-top: 5px; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 42px; }
.input-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--light); }
.input-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--forest); flex-shrink: 0; cursor: pointer; }
.form-check label { font-size: 13px; color: var(--mid); line-height: 1.5; cursor: pointer; }
.form-check a { color: var(--sage); text-decoration: none; }

.form-security-note {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: #f0f5f1; border-radius: 8px;
  margin-bottom: 20px; border: 1px solid rgba(74,124,84,0.15);
}
.form-security-note svg { width: 14px; height: 14px; stroke: var(--sage); fill: none; stroke-width: 2; flex-shrink: 0; }
.form-security-note span { font-size: 12px; color: var(--sage); }

.btn-submit {
  width: 100%; padding: 13px; background: var(--forest);
  color: var(--cream); border: none; border-radius: 8px;
  font-size: 14.5px; font-weight: 500; font-family: 'DM Sans', sans-serif;
  cursor: pointer; transition: all 0.25s; letter-spacing: 0.01em;
}
.btn-submit:hover { background: var(--moss); box-shadow: 0 6px 20px rgba(26,46,30,0.25); }
.btn-submit:active { transform: scale(0.99); }

.auth-divider { text-align: center; position: relative; margin: 20px 0; }
.auth-divider::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px; background:var(--border); }
.auth-divider span { position:relative; background:var(--chalk); padding:0 12px; font-size:12px; color:var(--light); }

.auth-switch { text-align:center; margin-top:16px; font-size:13.5px; color:var(--mid); }
.auth-switch a { color:var(--sage); text-decoration:none; font-weight:500; }

/* ─── OTP ─── */
.otp-inputs { display:flex; gap:10px; justify-content:center; margin:32px 0; }
.otp-input {
  width:52px; height:60px; text-align:center;
  font-size:24px; font-family:'Cormorant Garamond', serif; font-weight:400;
  border:1.5px solid var(--border-mid); border-radius:10px;
  background:white; color:var(--forest); outline:none; transition:all 0.2s;
}
.otp-input:focus { border-color:var(--sage); box-shadow:0 0 0 3px rgba(74,124,84,0.1); }
.otp-resend { text-align:center; font-size:13px; color:var(--mid); }
.otp-resend a { color:var(--sage); text-decoration:none; font-weight:500; cursor:pointer; }
.otp-timer { color:var(--light); font-size:12px; margin-top:8px; text-align:center; }

/* ─── PORTAL SHELL (shared by dashboard, wizard, vault, will-status) ─── */
:root { --sidebar-w: 260px; --header-h: 64px; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--forest);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(247,244,238,0.08); display: flex; align-items: center; gap: 10px; }
.sidebar-logo-mark { width: 34px; height: 34px; background: rgba(247,244,238,0.1); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-logo-mark svg { width: 18px; height: 18px; fill: var(--gold); }
.sidebar-logo-text { font-family: 'Cormorant Garamond', serif; font-size: 14px; color: var(--cream); font-weight: 500; line-height: 1.1; }
.sidebar-logo-text span { display: block; font-size: 9px; font-weight: 300; font-family: 'DM Sans', sans-serif; letter-spacing: 0.09em; color: rgba(247,244,238,0.35); text-transform: uppercase; margin-top: 1px; }

.sidebar-client { padding: 16px 20px; border-bottom: 1px solid rgba(247,244,238,0.08); display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(201,168,76,0.2); border: 1px solid rgba(201,168,76,0.3); display: flex; align-items: center; justify-content: center; font-family: 'Cormorant Garamond', serif; font-size: 16px; color: var(--gold); flex-shrink: 0; }
.sidebar-client-info strong { display: block; font-size: 13px; color: var(--cream); font-weight: 500; }
.sidebar-client-info span { font-size: 11px; color: rgba(247,244,238,0.35); letter-spacing: 0.04em; }
.sidebar-client-status { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex-shrink: 0; box-shadow: 0 0 6px rgba(74,222,128,0.4); }

.sidebar-nav { flex: 1; padding: 20px 12px; }
.sidebar-section-label { font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(247,244,238,0.25); padding: 0 8px; margin-bottom: 8px; margin-top: 20px; }
.sidebar-section-label:first-child { margin-top: 0; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; margin-bottom: 2px; transition: all 0.2s; text-decoration: none; }
.sidebar-link svg { width: 16px; height: 16px; stroke: rgba(247,244,238,0.4); fill: none; stroke-width: 1.5; flex-shrink: 0; transition: stroke 0.2s; }
.sidebar-link span { font-size: 13.5px; color: rgba(247,244,238,0.5); transition: color 0.2s; }
.sidebar-link .sidebar-badge { margin-left: auto; background: var(--gold); color: var(--deep); font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.sidebar-link:hover { background: rgba(247,244,238,0.06); }
.sidebar-link:hover svg { stroke: rgba(247,244,238,0.7); }
.sidebar-link:hover span { color: rgba(247,244,238,0.7); }
.sidebar-link.active { background: rgba(247,244,238,0.1); }
.sidebar-link.active svg { stroke: var(--gold); }
.sidebar-link.active span { color: var(--cream); font-weight: 500; }

.sidebar-progress-wrap { padding: 16px 20px; border-top: 1px solid rgba(247,244,238,0.08); }
.sidebar-progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.sidebar-progress-label span { font-size: 11px; color: rgba(247,244,238,0.4); }
.sidebar-progress-label strong { font-size: 11px; color: var(--gold); }
.sidebar-progress-bar { height: 4px; background: rgba(247,244,238,0.1); border-radius: 2px; overflow: hidden; }
.sidebar-progress-fill { height: 100%; background: linear-gradient(90deg, var(--sage), var(--gold)); border-radius: 2px; width: 20%; transition: width 0.6s cubic-bezier(0.22,1,0.36,1); }
.sidebar-progress-text { font-size: 11px; color: rgba(247,244,238,0.25); margin-top: 8px; text-align: center; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(247,244,238,0.08); }
.sidebar-footer-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-decoration: none; transition: background 0.2s; }
.sidebar-footer-link:hover { background: rgba(247,244,238,0.06); }
.sidebar-footer-link svg { width: 14px; height: 14px; stroke: rgba(247,244,238,0.3); fill: none; stroke-width: 1.5; }
.sidebar-footer-link span { font-size: 13px; color: rgba(247,244,238,0.35); }

.portal-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.portal-topbar { height: var(--header-h); background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 32px; position: sticky; top: 0; z-index: 50; gap: 20px; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; flex: 1; }
.topbar-breadcrumb span { font-size: 13px; color: var(--light); }
.topbar-breadcrumb strong { font-size: 13px; color: var(--charcoal); font-weight: 500; }
.topbar-breadcrumb svg { width: 14px; height: 14px; stroke: var(--light); fill: none; stroke-width: 1.5; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-notif { position: relative; width: 36px; height: 36px; border-radius: 8px; background: var(--cream); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.topbar-notif:hover { background: var(--forest); border-color: var(--forest); }
.topbar-notif:hover svg { stroke: var(--cream); }
.topbar-notif svg { width: 16px; height: 16px; stroke: var(--mid); fill: none; stroke-width: 1.5; }
.notif-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); border: 1.5px solid white; }

.portal-content { padding: 28px 32px; flex: 1; }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--forest); color: var(--cream);
  padding: 14px 20px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(15,28,18,0.25);
  z-index: 9999; font-size: 13.5px;
  transform: translateY(80px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 16px; height: 16px; stroke: var(--gold); fill: none; stroke-width: 2; flex-shrink: 0; }

/* ─── MODAL ─── */
.modal-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(15,28,18,0.6); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-box { background: white; border-radius: 16px; padding: 32px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); transform: scale(0.96) translateY(12px); transition: transform 0.35s cubic-bezier(0.22,1,0.36,1); }
.modal-overlay.active .modal-box { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 400; color: var(--forest); }
.modal-close { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); background: white; cursor: pointer; font-size: 16px; color: var(--light); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.modal-close:hover { background: var(--cream); color: var(--charcoal); }

/* ─── SHARED BUTTONS ─── */
.btn-primary-sm { padding: 10px 22px; background: var(--forest); color: var(--cream); border: none; border-radius: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.btn-primary-sm:hover { background: var(--moss); }
.btn-ghost-sm { padding: 9px 20px; border: 1px solid var(--border-mid); border-radius: 8px; background: white; font-size: 13.5px; color: var(--charcoal); cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.btn-ghost-sm:hover { border-color: var(--sage); color: var(--sage); }

/* ─── STATUS BADGES ─── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 500; }
.badge-green { background: #e8f5eb; color: #2d6a35; }
.badge-gold  { background: #fef9e7; color: #8a6a1a; }
.badge-blue  { background: #e8f0fe; color: #1a4a8a; }
.badge-mid   { background: var(--cream); color: var(--mid); }
.badge-red   { background: #fdecea; color: #8a1a1a; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .auth-left { display: none; }
  .auth-right { padding: 32px 24px; }
  .sidebar { transform: translateX(-100%); }
  .portal-main { margin-left: 0; }
}

/* ─── AUTH TABS (Sign In / Create Account toggle) ─── */
.auth-tabs { display: flex; gap: 0; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.auth-tab {
  padding: 10px 20px; font-size: 13.5px; color: var(--light);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s; user-select: none;
}
.auth-tab:hover { color: var(--forest); }
.auth-tab.active { color: var(--forest); font-weight: 500; border-bottom-color: var(--forest); }

/* ─── Shared stat + card components (used across portal + shop pages) ─── */
.stat-card {
  background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; transition: all 0.3s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card-label { font-size: 11.5px; color: var(--light); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; }
.stat-card-value { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 400; color: var(--forest); line-height: 1; margin-bottom: 8px; }
.stat-card-sub { font-size: 12px; color: var(--light); }
.dash-card { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.dash-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.dash-card-title { font-size: 15px; font-weight: 500; color: var(--forest); }
.form-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border-mid); border-radius: 8px;
  font-size: 14px; font-family: 'DM Sans', sans-serif;
  color: var(--charcoal); background: white;
  transition: border-color 0.2s; outline: none;
}
.form-input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(74,124,84,0.1); }
.form-full { grid-column: 1 / -1; }

/* ─── Responsive portal padding ─── */
@media (max-width: 1200px) {
  .portal-content { padding: 24px; }
}
@media (max-width: 768px) {
  .portal-content { padding: 16px; }
  #navbar { padding: 0 16px; }
}

/* ─── MOBILE SIDEBAR ─── */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: 56px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 60;
}
.hamburger {
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 8px;
  background: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--charcoal); flex-shrink: 0;
  transition: all 0.2s;
}
.hamburger:hover { background: var(--forest); color: white; border-color: var(--forest); }
.hamburger svg { width: 16px; height: 16px; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(15,28,18,0.5);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .portal-main { margin-left: 0; }
}

/* ── Sidebar logo link + name (class names used in portal-header.ejs) ── */
.sidebar-logo { padding: 20px 16px; border-bottom: 1px solid rgba(247,244,238,0.08); }
.sidebar-logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sidebar-logo-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px; font-weight: 500; color: var(--cream); line-height: 1.1;
}
.sidebar-logo-name span {
  display: block; font-size: 9px; font-weight: 300;
  font-family: 'DM Sans', sans-serif; letter-spacing: 0.09em;
  color: rgba(247,244,238,0.35); text-transform: uppercase; margin-top: 1px;
}
