:root {
  --bg: #fff9e8;
  --bg-deep: #f8f0d7;
  --surface: #ffffff;
  --surface-warm: #fffcf3;
  --pineapple: #f4b51f;
  --pineapple-bright: #ffd55a;
  --pineapple-dark: #dc9400;
  --pineapple-soft: #fff0b5;
  --pineapple-pale: #fff8dc;
  --pineapple-ink: #1f4a35;
  --pineapple-deep: #153727;
  --input: #fff9e7;
  --input-focus: #fff3bf;
  --text: #23352c;
  --muted: #68766e;
  --border: #e9dfbd;
  --border-strong: #dcca88;
  --white: #ffffff;
  --success: #21875a;
  --danger: #c64d42;
  --shadow-sm: 0 10px 28px rgba(47, 72, 56, 0.09);
  --shadow-md: 0 24px 65px rgba(47, 72, 56, 0.14);
  --shadow-yellow: 0 14px 30px rgba(220, 148, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 213, 90, 0.34), transparent 25rem),
    radial-gradient(circle at 92% 82%, rgba(48, 126, 82, 0.1), transparent 28rem),
    linear-gradient(145deg, #fffdf7 0%, var(--bg) 48%, #fffdf8 100%);
  font-family: Fredoka, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(244, 181, 31, 0.2);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

body::before {
  top: -190px;
  right: -90px;
  box-shadow:
    0 0 0 42px rgba(244, 181, 31, 0.035),
    0 0 0 86px rgba(244, 181, 31, 0.025);
}

body::after {
  bottom: -220px;
  left: -110px;
  box-shadow:
    0 0 0 48px rgba(31, 74, 53, 0.025),
    0 0 0 96px rgba(31, 74, 53, 0.018);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(244, 181, 31, 0.4);
  outline-offset: 3px;
}

a {
  color: var(--pineapple-ink);
  text-decoration-color: rgba(31, 74, 53, 0.38);
  text-underline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-shell {
  display: grid;
  place-items: start center;
  min-height: 100vh;
  padding: 34px 18px 48px;
}

.home-card {
  position: relative;
  width: min(100%, 760px);
  padding: 0 34px 26px;
  border: 1px solid rgba(233, 223, 189, 0.9);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: card-in 420ms ease-out both;
  backdrop-filter: blur(18px);
}

.home-card-accent {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--pineapple-dark), var(--pineapple-bright) 48%, #7eb35b);
}

.brand-header {
  height: 278px;
  overflow: hidden;
  text-align: center;
}

.brand-logo {
  display: block;
  width: min(100%, 570px);
  height: auto;
  margin: -34px auto 0;
  mix-blend-mode: multiply;
}

.welcome-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: -4px 0 20px;
  text-align: center;
}

.welcome-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(33, 135, 90, 0.16);
  border-radius: 999px;
  color: var(--success);
  background: rgba(33, 135, 90, 0.07);
  font-size: 0.84rem;
  font-weight: 700;
}

.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #32a76d;
  box-shadow: 0 0 0 4px rgba(50, 167, 109, 0.12);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.login-form,
.form-panel {
  display: grid;
}

.login-form {
  gap: 18px;
}

.form-panel {
  gap: 15px;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.login-form[data-active-panel="login"] .mode-row,
.login-form[data-active-panel="password-reset"] .mode-row {
  display: none;
}

.mode-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.mode-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-warm);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.mode-option:hover .mode-card {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.mode-option > input:checked + .mode-card {
  border-color: var(--pineapple);
  background: linear-gradient(145deg, #fffaf0, var(--pineapple-pale));
  box-shadow:
    0 0 0 3px rgba(244, 181, 31, 0.15),
    var(--shadow-sm);
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--pineapple-ink);
  background: var(--pineapple-soft);
  font-size: 1.05rem;
  font-weight: 900;
}

.mode-option > input:checked + .mode-card .mode-icon {
  color: var(--pineapple-deep);
  background: linear-gradient(145deg, var(--pineapple-bright), var(--pineapple));
}

.mode-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mode-copy strong {
  color: var(--pineapple-deep);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 0.88rem;
  line-height: 1.15;
}

.mode-copy small {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.25;
}

.guest-panel,
.certified-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 252, 243, 0.96)),
    var(--surface-warm);
  box-shadow: 0 14px 35px rgba(47, 72, 56, 0.06);
  animation: panel-in 220ms ease-out both;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading > div {
  display: grid;
  gap: 3px;
}

.section-heading h2 {
  margin: 0;
  color: var(--pineapple-deep);
  font-family: Montserrat, Arial, sans-serif;
  font-size: clamp(1.22rem, 4vw, 1.48rem);
  line-height: 1.15;
}

.step-label {
  color: var(--pineapple-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.age-badge,
.verified-badge {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--pineapple-ink);
  background: var(--pineapple-soft);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 900;
}

.verified-badge {
  color: var(--white);
  background: var(--pineapple-ink);
}

.panel-intro {
  margin: -4px 0 2px;
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  position: relative;
  gap: 7px;
  min-width: 0;
}

.field > span,
.profile-fieldset legend {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.field > span small {
  color: var(--muted);
  font-weight: 500;
}

.field-grid {
  display: grid;
  grid-template-columns: 0.68fr 1.32fr;
  gap: 14px;
}

.field-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--pineapple-deep);
  background: var(--input);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.field input::placeholder {
  color: #9a947f;
}

.field input:focus {
  border-color: var(--pineapple);
  background: var(--white);
  box-shadow:
    0 0 0 4px rgba(244, 181, 31, 0.14),
    0 8px 22px rgba(47, 72, 56, 0.06);
}

.field input::selection {
  background: rgba(244, 181, 31, 0.32);
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  display: none;
  max-height: 238px;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
  list-style: none;
}

.suggestions.is-open {
  display: block;
}

.suggestions li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}

.suggestions li:hover,
.suggestions li.is-active {
  background: var(--pineapple-pale);
}

.suggestions strong {
  color: var(--pineapple-deep);
  font-weight: 600;
}

.suggestions small {
  color: var(--muted);
  white-space: nowrap;
}

.profile-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.profile-fieldset legend {
  margin-bottom: 8px;
}

.gender-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gender-row label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.gender-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gender-row span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  background: var(--white);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  transition: 150ms ease;
}

.gender-row label:hover span {
  border-color: var(--border-strong);
}

.gender-row input:checked + span {
  border-color: var(--pineapple);
  color: var(--pineapple-deep);
  background: var(--pineapple-soft);
  box-shadow: 0 0 0 3px rgba(244, 181, 31, 0.12);
}

.chat-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 0 19px 2px;
  border: 0;
  border-radius: 14px;
  color: var(--pineapple-deep);
  background: linear-gradient(135deg, var(--pineapple-bright) 0%, var(--pineapple) 62%, #e7a20c 100%);
  box-shadow:
    inset 0 -3px 0 rgba(128, 82, 0, 0.16),
    var(--shadow-yellow);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 150ms ease,
    filter 150ms ease,
    box-shadow 150ms ease;
}

.chat-button:hover:not(:disabled) {
  filter: saturate(1.05) brightness(1.02);
  transform: translateY(-2px);
  box-shadow:
    inset 0 -3px 0 rgba(128, 82, 0, 0.16),
    0 18px 34px rgba(220, 148, 0, 0.3);
}

.chat-button:active:not(:disabled) {
  transform: translateY(0);
}

.chat-button:disabled {
  cursor: wait;
  filter: grayscale(0.2);
  opacity: 0.72;
}

.privacy-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.check-line {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  margin: 2px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.check-line input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--pineapple-ink);
}

.code-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(244, 181, 31, 0.35);
  border-radius: 15px;
  background: var(--pineapple-pale);
}

.code-panel-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--white);
  background: var(--pineapple-ink);
}

.reset-code-fields {
  display: grid;
  gap: 13px;
}

.form-message {
  display: none;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  background: rgba(104, 118, 110, 0.08);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.form-message:not(:empty) {
  display: block;
}

.form-message[data-type="success"] {
  color: #176f49;
  background: rgba(33, 135, 90, 0.09);
}

.form-message[data-type="error"] {
  color: #a63e35;
  background: rgba(198, 77, 66, 0.09);
}

.login-panel {
  margin-top: 0;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.login-options .check-line {
  margin: 0;
}

.back-button,
.account-link,
.inline-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.back-button {
  justify-self: center;
  padding: 6px 10px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.back-button:hover,
.inline-button:hover {
  color: var(--pineapple-ink);
}

.inline-button {
  padding: 2px 0;
  color: var(--pineapple-ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(31, 74, 53, 0.28);
  text-underline-offset: 3px;
}

.home-footer {
  display: grid;
  justify-items: center;
  gap: 17px;
  margin-top: 20px;
}

.account-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-warm);
}

.account-link {
  padding: 3px 0;
  color: var(--pineapple-ink);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(31, 74, 53, 0.3);
  text-underline-offset: 3px;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.trust-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.trust-strip span + span {
  border-left: 1px solid var(--border);
}

.trust-strip b {
  color: var(--pineapple-ink);
  font-weight: 900;
}

.home-footer nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.82rem;
}

.home-footer nav a {
  color: var(--muted);
  text-decoration: none;
}

.home-footer nav a:hover {
  color: var(--pineapple-ink);
}

.admin-login-card {
  width: min(100%, 560px);
}

.admin-auth-page .page-shell {
  place-items: center;
}

.admin-login-card .brand-header {
  height: 250px;
}

.admin-login-card .brand-logo {
  width: 500px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 12px 10px 26px;
  }

  .home-card {
    padding: 0 15px 20px;
    border-radius: 22px;
  }

  .brand-header {
    height: clamp(210px, 64vw, 268px);
  }

  .brand-logo {
    width: min(115%, 550px);
    max-width: none;
    margin-top: -24px;
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .welcome-copy {
    margin-top: 0;
  }

  .mode-row {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 66px;
  }

  .guest-panel,
  .certified-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .field-grid,
  .field-grid.compact {
    grid-template-columns: 1fr;
  }

  .gender-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-panel {
    grid-template-columns: 1fr;
  }

  .code-panel-icon {
    display: none;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .trust-strip span + span {
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 420px) {
  .brand-header {
    height: 205px;
  }

  .brand-logo {
    width: 122%;
    margin-top: -15px;
  }

  .welcome-copy p {
    max-width: 290px;
    font-size: 0.9rem;
  }

  .account-callout {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

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