:root {
  --paper: #f8f7f3;
  --surface: #ffffff;
  --ink: #16221c;
  --muted: #5c6b61;
  --brand: #2f6b51;
  --brand-deep: #245640;
  --pale: #e2efe7;
  --line: #d9dfda;
  --gold: #f4cf8a;
  --lavender: #eadff2;
  --danger-bg: #fff0ed;
  --danger: #9b3d2f;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 750; }
.brand-mark { position: relative; display: inline-block; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px; background: var(--brand); }
.brand-mark i { position: absolute; display: block; border-radius: 999px; background: white; }
.brand-mark i:nth-child(1) { width: 18px; height: 18px; left: 10px; top: 21px; }
.brand-mark i:nth-child(2) { width: 20px; height: 20px; left: 20px; top: 13px; }
.brand-mark i:nth-child(3) { width: 11px; height: 11px; left: 27px; top: 24px; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(520px, 54%) 1fr; }
.auth-story { position: relative; min-height: 100vh; overflow: hidden; padding: 56px 7vw; background: var(--pale); }
.story-copy { position: relative; z-index: 2; max-width: 590px; margin-top: 14vh; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 13px; font-weight: 750; letter-spacing: .04em; }
.story-copy h1 { margin: 0 0 24px; font-size: clamp(46px, 5vw, 68px); line-height: 1.12; letter-spacing: -.045em; }
.story-copy > p:not(.eyebrow) { max-width: 560px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.story-copy ul { display: grid; gap: 14px; margin: 34px 0 0; padding: 0; list-style: none; font-size: 15px; }
.story-copy li::before { content: "✓"; margin-right: 10px; color: var(--brand); font-weight: 800; }
.story-orbit { position: absolute; right: -130px; bottom: -180px; width: 560px; height: 560px; border: 95px solid var(--gold); border-radius: 50%; background: var(--brand); }
.story-orbit span { position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 92px; transform: translateY(-6px); }

.auth-panel-wrap { display: grid; place-items: center; padding: 50px; }
.auth-card { width: min(100%, 430px); padding: 44px 42px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 20px 60px rgba(28, 45, 36, .08); }
.mobile-brand { display: none; }
.auth-card h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.auth-intro { margin: 8px 0 30px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-card label { display: block; margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.auth-card input[type="text"], .auth-card input[type="password"] { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #cfd7d1; border-radius: 10px; outline: none; color: var(--ink); background: white; transition: border-color .18s, box-shadow .18s; }
.auth-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 81, .13); }
.password-field { position: relative; }
.password-field input { padding-right: 64px !important; }
.password-toggle { position: absolute; right: 8px; top: 7px; height: 34px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--brand); background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.primary-button { width: 100%; height: 48px; margin-top: 26px; border: 0; border-radius: 11px; color: white; background: var(--brand); cursor: pointer; font-weight: 750; }
.primary-button:hover { background: var(--brand-deep); }
.form-error { margin: 18px 0 4px; padding: 12px 14px; border-radius: 10px; color: var(--danger); background: var(--danger-bg); font-size: 13px; }
.invite-note { margin: 22px 0 0; text-align: center; color: var(--brand); font-size: 13px; font-weight: 700; }
.privacy-note { margin: 70px 0 0; text-align: center; color: var(--muted); font-size: 11px; }

.portal-header { width: min(1296px, calc(100% - 48px)); height: 104px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.portal-header form { margin: 0; }
.small-button { display: inline-grid; min-height: 38px; place-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; font-size: 13px; font-weight: 750; }
.portal-main, .dashboard-main { width: min(1296px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 52px; }
.portal-hero { position: relative; min-height: 330px; overflow: hidden; display: flex; align-items: center; padding: 56px; border-radius: 30px; background: var(--pale); }
.portal-hero h1 { margin: 0 0 20px; font-size: clamp(38px, 4vw, 58px); line-height: 1.15; letter-spacing: -.045em; }
.portal-hero p:not(.eyebrow) { max-width: 640px; color: var(--muted); line-height: 1.7; }
.hero-art { position: absolute; right: 7%; top: 50%; width: 190px; height: 190px; display: grid; place-items: center; transform: translateY(-50%); border-radius: 50%; color: white; background: var(--brand); box-shadow: 125px 80px 0 40px var(--gold); font-size: 70px; }
.tool-section { margin-top: 44px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 24px; }
.section-heading span { color: var(--brand); font-size: 12px; font-weight: 700; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tool-card { min-height: 230px; display: flex; flex-direction: column; align-items: flex-start; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.tool-card:hover { border-color: #b9c9be; transform: translateY(-1px); }
.tool-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 15px; font-size: 22px; font-style: normal; }
.travel-icon { background: #f8d99e; }
.xhs-icon { color: #664681; background: var(--lavender); }
.ai-icon { color: white; background: #24382d; font-size: 15px; font-weight: 800; }
.tool-card strong { font-size: 18px; }
.tool-card small { margin-top: 8px; color: var(--muted); font-size: 13px; }
.tool-card em { margin-top: auto; color: var(--brand); font-size: 12px; font-style: normal; font-weight: 750; }
.muted-card { color: #47534b; }
.featured-card { background: var(--pale); border-color: var(--pale); }
.public-safety { margin: 34px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.dashboard-main { padding-top: 34px; }
.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.dashboard-heading h1 { margin: 0; font-size: 38px; }
.dashboard-heading p:last-child { color: var(--muted); }
.account-avatar { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 54px; border-radius: 50%; color: white; background: var(--brand); font-weight: 800; }
.route-banner { width: min(100%, 430px); display: flex; align-items: center; gap: 12px; margin: 26px 0 38px; padding: 13px 15px; border-radius: 14px; background: var(--pale); }
.route-banner > span { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--brand); }
.route-banner div { display: grid; gap: 2px; }
.route-banner strong { font-size: 13px; }
.route-banner small { color: var(--muted); font-size: 11px; }
.access-denied-card { max-width: 680px; margin: 8vh auto 0; padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 20px 60px rgba(28, 45, 36, .08); }
.access-denied-card h1 { margin: 0 0 16px; font-size: clamp(30px, 4vw, 46px); line-height: 1.15; }
.access-denied-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.75; }
.primary-link { display: inline-grid; min-height: 44px; place-items: center; margin-top: 18px; padding: 0 18px; border-radius: 11px; color: white; background: var(--brand); font-size: 14px; font-weight: 750; }

@media (max-width: 840px) {
  .auth-shell { display: block; }
  .auth-story { display: none; }
  .auth-panel-wrap { position: relative; min-height: 100svh; overflow: hidden; align-items: start; padding: 28px 24px 44px; }
  .auth-panel-wrap::before { content: ""; position: absolute; width: 330px; height: 330px; right: -150px; top: -150px; border-radius: 50%; background: #dcebe2; }
  .auth-card { position: relative; z-index: 1; width: 100%; max-width: 430px; margin-top: 18px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .mobile-brand { display: inline-flex; margin-bottom: 74px; }
  .auth-card h2 { font-size: 30px; }
  .privacy-note { margin-top: 74px; }
  .portal-header { height: 88px; }
  .portal-header .brand span:last-child { display: none; }
  .portal-main, .dashboard-main { width: min(100% - 32px, 520px); }
  .portal-hero { min-height: 270px; align-items: flex-start; padding: 28px 22px; border-radius: 22px; }
  .portal-hero h1 { font-size: 30px; }
  .portal-hero p:not(.eyebrow) { max-width: 260px; font-size: 13px; }
  .hero-art { width: 92px; height: 92px; right: 8%; top: 74%; box-shadow: 70px 42px 0 20px var(--gold); font-size: 36px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 178px; }
  .dashboard-main { padding-top: 20px; }
  .dashboard-heading h1 { font-size: 28px; }
  .dashboard-heading p:last-child { font-size: 13px; line-height: 1.6; }
  .route-banner { margin: 20px 0 30px; }
}

@media (prefers-reduced-motion: no-preference) {
  .tool-card, .primary-button { transition: transform .18s ease, border-color .18s ease, background-color .18s ease; }
}
