:root {
  --brand: #ee7943;
  --brand-strong: #d8612d;
  --accent: #8da249;
  --surface: #fff3e8;
  --surface-raised: #fffdf8;
  --text: #3a1c15;
  --text-secondary: #6b4438;
  --border: #e7cfc0;
  --muted: #f2d9c9;
  --error: #b13f32;
  --shadow: 0 22px 60px rgba(90, 45, 35, 0.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, rgba(238, 121, 67, 0.15), transparent 32rem),
    radial-gradient(circle at 90% 90%, rgba(141, 162, 73, 0.13), transparent 34rem),
    var(--surface);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

button, input, select { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 64px);
  border-bottom: 2px solid rgba(231, 207, 192, 0.8);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px);
}

.brand-lockup { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 15px; background: var(--brand); color: white;
  font-family: 'Caprasimo', serif; font-size: 24px;
  box-shadow: 0 8px 22px rgba(238, 121, 67, 0.28);
}
.brand-lockup strong { display: block; font-family: 'Caprasimo', serif; font-size: 19px; font-weight: 400; }
.brand-lockup small { display: block; color: var(--text-secondary); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.account-actions { display: flex; align-items: center; gap: 14px; }
.whoami { color: var(--text-secondary); font-size: 12px; font-weight: 600; }

main { min-height: calc(100vh - 138px); }
.auth-layout {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: calc(100vh - 138px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
  padding: 52px 0;
}

.eyebrow { color: var(--brand-strong); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: 'Caprasimo', serif; font-weight: 400; }
h1 { font-size: clamp(38px, 6vw, 70px); line-height: 1.04; letter-spacing: -.02em; }
h2 { font-size: 27px; }
.welcome-copy > p:last-child { max-width: 570px; color: var(--text-secondary); font-size: 17px; line-height: 1.7; }
.auth-card, .center-card {
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.auth-card { padding: 32px; }
.muted { color: var(--text-secondary); line-height: 1.55; }
label { display: block; margin: 24px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
input, select {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 2px solid var(--border); border-radius: 13px;
  background: white; color: var(--text); outline: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 121, 67, .13); }
.phone-field { display: flex; align-items: center; border: 2px solid var(--border); border-radius: 13px; background: white; }
.phone-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 121, 67, .13); }
.phone-field span { padding-left: 14px; color: var(--text-secondary); font-weight: 700; }
.phone-field input { border: 0; box-shadow: none; padding-left: 8px; }
.recaptcha { min-height: 6px; margin-top: 16px; }

.button {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 18px; border: 2px solid transparent; border-radius: 13px;
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-strong); }
.button.ghost { border-color: var(--border); background: transparent; color: var(--text); }
.button.text { background: transparent; color: var(--brand-strong); }
.button.full { width: 100%; margin-top: 18px; }
.message { min-height: 24px; margin-top: 12px; font-size: 13px; line-height: 1.5; }
.message.error { color: var(--error); }
.message.success { color: #557021; }

.center-card { width: min(600px, calc(100% - 40px)); margin: 10vh auto; padding: 48px; text-align: center; }
.center-card h1 { margin-top: 18px; font-size: 34px; }
.center-card p { color: var(--text-secondary); line-height: 1.7; }
.empty-icon { width: 58px; height: 58px; margin: auto; display: grid; place-items: center; border-radius: 20px; background: var(--muted); color: var(--brand-strong); font-size: 28px; font-weight: 700; }
.spinner { width: 34px; height: 34px; margin: auto; border: 4px solid var(--muted); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.portal-shell { min-height: calc(100vh - 138px); display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.sidebar { padding: 30px 22px; border-right: 2px solid var(--border); background: rgba(255, 253, 248, .72); }
.business-switcher { padding: 0 10px 24px; border-bottom: 2px solid var(--border); }
.business-switcher label { margin-top: 0; }
.single-business { font-family: 'Caprasimo', serif; font-size: 20px; }
.role-badge { display: inline-flex; margin-top: 9px; padding: 5px 9px; border-radius: 999px; background: var(--muted); color: var(--text-secondary); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
#portal-nav { display: grid; gap: 7px; margin-top: 22px; }
.nav-button { width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 13px; background: transparent; color: var(--text-secondary); text-align: left; font-weight: 700; cursor: pointer; }
.nav-button:hover, .nav-button.active { background: var(--muted); color: var(--text); }
.workspace { padding: clamp(30px, 5vw, 70px); }
.workspace-card { max-width: 820px; padding: clamp(28px, 4vw, 48px); border: 2px solid var(--border); border-radius: 24px; background: var(--surface-raised); box-shadow: var(--shadow); }
.workspace-card h1 { font-size: clamp(34px, 5vw, 52px); }
.workspace-card p { max-width: 650px; color: var(--text-secondary); line-height: 1.7; }
.status-pill { display: inline-flex; margin-bottom: 20px; padding: 7px 11px; border-radius: 999px; color: #557021; background: rgba(141, 162, 73, .16); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

footer { height: 62px; display: flex; align-items: center; justify-content: center; gap: 22px; border-top: 2px solid var(--border); color: var(--text-secondary); font-size: 11px; font-weight: 600; }

@media (max-width: 760px) {
  .topbar { padding: 0 18px; }
  .whoami { display: none; }
  .auth-layout { grid-template-columns: 1fr; gap: 30px; padding: 42px 0; }
  .portal-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 2px solid var(--border); }
  #portal-nav { display: flex; overflow-x: auto; }
  .nav-button { min-width: max-content; }
  .workspace { padding: 24px 18px 40px; }
  .center-card { padding: 34px 22px; }
}
