/* Public authentication pages share the shop's palette without loading the app shell. */
:root {
  color-scheme: light;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-synthesis: none;
  --auth-green: #236b49;
  --auth-pine: #174c34;
  --auth-green-soft: #e7f2eb;
  --auth-paper: #f5f7f6;
  --auth-ink: #17231d;
  --auth-muted: #5b685f;
  --auth-line: #dfe7e1;
  color: var(--auth-ink);
  background: var(--auth-paper);
}

* { box-sizing: border-box; }
body { min-width: 280px; margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--auth-green); outline-offset: 4px; }

.auth-page {
  --hero-height: clamp(290px, 43svh, 390px);
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: var(--hero-height) 1fr;
}

.auth-hero {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: calc(24px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 44px max(24px, env(safe-area-inset-left));
  overflow: hidden;
  color: #fff;
  background: var(--auth-green);
}

.auth-brand { display: flex; align-self: flex-start; align-items: center; gap: 11px; }
.auth-brand-mark { width: 42px; height: 42px; flex: none; border-radius: 12px; background: #fff; }
.auth-brand-mark path { fill: var(--auth-green); }
.auth-brand strong { display: block; font: 600 21px/1.1 Rubik, sans-serif; letter-spacing: -.04em; }
.auth-brand small { display: block; margin-top: 4px; color: #e0eee4; font-size: 12px; line-height: 1.2; }
.shop-scene { display: block; width: min(100%, 276px); min-height: 0; flex: 1; margin-top: 10px; overflow: visible; }
.hero-message { display: none; }
.shop-features { display: flex; flex: none; justify-content: center; gap: 25px; margin-top: 10px; color: #e6f0e9; font-size: 12px; font-weight: 700; }
.shop-features span { display: inline-flex; align-items: center; gap: 7px; }
.shop-features svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.auth-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin-top: -25px;
  padding: 34px max(28px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  border-radius: 28px 28px 0 0;
  background: var(--auth-paper);
}

.auth-content { width: min(100%, 400px); margin-block: auto; margin-inline: auto; }
h1 { margin: 0; font: 600 clamp(32px, 8.5vw, 40px)/1.15 Rubik, sans-serif; letter-spacing: -.055em; text-wrap: balance; }
.auth-description { max-width: 36ch; margin: 12px 0 28px; color: var(--auth-muted); font-size: 16px; line-height: 1.6; }
.button-area { display: grid; min-height: 44px; justify-items: center; }
.button-area > * { width: 100%; }
#googleButton { min-width: 0; }
.sign-in-placeholder { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--auth-line); border-radius: 4px; color: var(--auth-muted); background: #fff; font-size: 14px; }
.loading-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--auth-green); animation: status-breathe 1.6s ease-in-out infinite; }
.auth-status { min-height: 20px; margin: 14px 0 0; color: var(--auth-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.auth-status[data-error="true"] { color: #a12e27; }
.signin-note { display: flex; align-items: flex-start; gap: 9px; margin: 26px 0 0; padding-top: 22px; border-top: 1px solid var(--auth-line); color: var(--auth-muted); font-size: 13px; line-height: 1.6; }
.signin-note svg { width: 17px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: var(--auth-green); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-footer { width: min(100%, 400px); margin: 28px auto 0; color: var(--auth-muted); font-size: 12px; line-height: 1.5; text-align: center; }

.access-page { --hero-height: clamp(230px, 32svh, 300px); }
.access-page .shop-scene { width: min(100%, 234px); margin-top: 6px; }
.access-page .auth-description { margin-bottom: 20px; }
.account-summary { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--auth-line); border-radius: 14px; background: #fff; }
.account-avatar { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 50%; color: var(--auth-green); background: var(--auth-green-soft); }
.account-avatar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.account-copy { min-width: 0; }
.account-copy small { display: block; margin-bottom: 3px; color: var(--auth-muted); font-size: 12px; }
#account { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
#accessStatus { position: relative; min-height: 40px; margin: 17px 0 22px; padding-left: 19px; color: var(--auth-muted); font-size: 13px; line-height: 1.55; }
#accessStatus::before { position: absolute; top: 6px; left: 1px; width: 7px; height: 7px; border-radius: 50%; background: #9c6b18; content: ""; animation: status-breathe 1.8s ease-in-out infinite; }
#accessStatus[data-state="granted"] { color: var(--auth-green); }
#accessStatus[data-state="granted"]::before { background: var(--auth-green); animation: none; }
#accessStatus[data-state="retry"] { color: #78571c; }
#accessStatus[data-state="retry"]::before { animation: none; }
.auth-actions { display: grid; gap: 10px; }
.auth-actions form { margin: 0; }
.auth-button { display: inline-flex; width: 100%; min-height: 50px; align-items: center; justify-content: center; gap: 10px; padding: 12px 18px; border: 1px solid transparent; border-radius: 12px; color: #fff; background: var(--auth-green); font: 700 15px/1.4 "Nunito Sans", sans-serif; text-align: center; text-decoration: none; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.auth-button svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-button:hover { background: var(--auth-pine); }
.auth-button:active { background: var(--auth-pine); }
.auth-button-secondary { color: var(--auth-muted); border-color: var(--auth-line); background: transparent; }
.auth-button-secondary:hover { color: var(--auth-ink); border-color: var(--auth-green); background: var(--auth-green-soft); }

@keyframes status-breathe { 50% { opacity: .35; } }

@media (max-width: 359px) {
  .auth-panel { padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
  .shop-features { gap: 17px; }
}

@media (min-width: 800px) {
  .auth-page { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .auth-hero { min-height: 100vh; min-height: 100dvh; padding: 40px 48px 48px; }
  .auth-brand { width: min(100%, 480px); margin-inline: auto; }
  .shop-scene, .access-page .shop-scene { width: min(100%, 420px); max-height: 340px; flex: none; margin-top: auto; }
  .hero-message { display: block; margin: 24px 0; font: 600 clamp(30px, 3.6vw, 48px)/1.15 Rubik, sans-serif; letter-spacing: -.05em; text-align: center; }
  .shop-features { margin-top: auto; padding-top: 24px; font-size: 14px; }
  .auth-panel { justify-content: center; margin: 0; padding: 48px; border-radius: 0; }
  .auth-content { margin-block: auto; }
  .auth-footer { margin-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
