:root { --accent: #2A7982; --logo-color: #0f172a; --transition-speed: 0.25s; }
* { box-sizing: border-box; }
body { font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin: 0; background: #f8fafc; color: #0f172a; }
.container { max-width: 980px; margin: 0 auto; padding: 20px; padding-bottom: 85px; }
h1, h2, h3 { margin: 0.4rem 0 0.6rem; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.25rem; color: #0b3a40; display: inline; }
p.lead { color: #334155; margin-top: 0; }
.card { background: #fff; border-radius: 16px; box-shadow: 0 10px 25px rgba(2,6,23,.06); padding: 20px; margin: 16px 0; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
/* Keep 2 columns for specific grids between 640px and 860px */
@media (max-width: 860px) and (min-width: 640px) { .grid-2.grid-md-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.muted { margin-bottom: 8px; color: #475569; font-size: .95rem; }
.pill { display: inline-block; background: #e2f0f2; color: #0b3a40; padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: .8rem; margin-left: 8px; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease; }
.section-title { display:flex; align-items:center; gap: 10px; margin-bottom: 8px; }
.section-title .right { margin-left:auto; }
.profile { display:flex; align-items:center; gap:12px; padding:0; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease; }
.profile .avatar { width:126px; border-radius:999px; object-fit:cover; background:#e5e7eb; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease; }
.profile .name { font-weight:700; font-size:1.05rem; color:#0f172a; transition: opacity var(--transition-speed) ease; }
.profile .line { color:#334155; font-size:.95rem; transition: opacity var(--transition-speed) ease; }
.profile .right { margin-left:auto; }
.section-title .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.q { border-bottom: 1px dashed #e2e8f0; padding: 10px 0; }
.scale { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.scale label { display: inline-flex; gap: 10px; align-items: center; padding: 12px 16px; min-height: 44px; min-width: 44px; border: 1px solid #e5e7eb; border-radius: 12px; cursor: pointer; user-select:none; transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease, color var(--transition-speed) ease, transform 0.15s ease; }
.scale input { accent-color: var(--accent); }
/* Visually hide radios but keep accessible */
.scale label input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
/* Highlight selected option */
.scale label:has(input:checked) { background: rgb(42, 121, 130); color: #ffffff; border-color: rgb(42, 121, 130); }
.scale label:has(input:checked) input { accent-color: #ffffff; }
/* Keyboard focus ring */
.scale label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sticky-footer { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); padding: 12px 20px; border-top: 1px solid #e5e7eb; display: none; gap: 10px; align-items: center; justify-content: space-between; z-index: 10; min-height: 65px; transform: translateY(100%); transition: transform 0.5s ease; }
.sticky-footer.visible { display: flex; transform: translateY(0); }
button.primary { background: var(--accent); color: #fff; padding: 12px 16px; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease, background-color var(--transition-speed) ease; }
button.primary:hover:not(:disabled) { background: #1f5a61; transform: translateY(-1px); }
button.primary:active:not(:disabled) { transform: translateY(0); }
button.primary:disabled { background: #94a3b8; cursor: not-allowed; opacity: 0.6; }
button.secondary { background: #0b3a400d; color: #0b3a40; padding: 10px 14px; border: 1px solid #0b3a4022; border-radius: 12px; font-weight: 600; cursor: pointer; margin-right: 8px; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease, background-color var(--transition-speed) ease, border-color var(--transition-speed) ease; }
button.secondary:hover { background: #0b3a4018; border-color: #0b3a4044; transform: translateY(-1px); }
button.secondary:active { transform: translateY(0); }
.result { background: #f0f9fb; border: 1px solid #cbe6ea; border-radius: 12px; padding: 12px; font-size: .95rem; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease; }
.result:empty { display: none; }
.error { color: #b91c1c; }
.ok { color: #166534; }
.small { font-size: .85rem; color: #475569; }
.tags { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px;}
.tag { background:#e5f4f6; border:1px solid #c8e6ea; padding:4px 8px; border-radius:999px; font-size:.8rem; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease, background-color var(--transition-speed) ease, border-color var(--transition-speed) ease; }
.divider { height:1px; background:#e5e7eb; margin:12px 0;}
/* Logo color follows theme via CSS variable */
.logo-gt { color: var(--logo-color); }
/* DISC progress pill */
.progress-pill{ position:relative; display:inline-flex; align-items:center; gap:0; height:24px; padding:2px 10px; background:#e2f0f2; border:1px solid #cbe6ea; border-radius:999px; overflow:hidden; margin-left:8px; flex:1 1 auto; min-width:80px; }
.progress-pill .bar{ position:absolute; inset:0; width:0%; background:rgba(42,121,130,.25); transition:width .35s ease; border-radius:999px; }
.progress-pill .text{ position:relative; font-size:.8rem; font-weight:700; color:#0b3a40; }
.progress-pill.pulse{ animation:pillpulse .35s ease; }
@keyframes pillpulse{ 0%{ transform:scale(1);} 50%{ transform:scale(1.04);} 100%{ transform:scale(1);} }
/* Sticky section headers (e.g., Gifts) */
.sticky-header{ position: sticky; top: 0; z-index: 6; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); padding: 8px 0; margin: -4px 0 8px 0; border-bottom: 1px solid #e5e7eb; }
.sticky-header .progress-pill{ display:block; width:100%; margin:0 0 8px 0; }
.header-with-progress .progress-pill{ display:block; width:100%; margin:0 0 8px 0; }
/* PCO splash sign-in */
.splash-card { text-align: center; }
button.btn-xl { font-size: 1.1rem; padding: 16px 24px; border-radius: 14px; display: inline-block; }
/* Phone step results */
.profile-choice { display:flex; align-items:center; gap:10px; padding:10px; border:1px solid #e5e7eb; border-radius:12px; cursor:pointer; transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease, background-color var(--transition-speed) ease, border-color var(--transition-speed) ease; }
.profile-choice:hover { background:#f8fafc; border-color: var(--accent); transform: translateY(-1px); }
/* Always hide manual input grids (we display profile info instead) */
.manual-inputs { display: none !important; }
/* Fade animation utilities */
.fade-out { opacity: 0; visibility: hidden; transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease; }
.fade-in { opacity: 1; visibility: visible; transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease; }
/* Phone input styling */
#phone {
  transition: border-bottom-color var(--transition-speed) ease;
}
#phone:focus {
  border-bottom-color: var(--accent);
}
/* Prevent initial flash: show only header while booting */
body.booting .container > *:not(header) { display: none !important; }
/* Mobile-specific styles */
@media (max-width: 768px) {
  /* Logout button overlaps profile info on mobile, top right */
  #your-info {
    position: relative;
  }
  #btn-logout {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    margin: 0 !important;
  }
  .profile .right {
    margin-left: 0;
  }
  /* Instruction pills (1–5, 1–3) move to new line on mobile */
  .section-title {
    flex-wrap: wrap;
  }
  .section-title .pill {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
}
/* System dark mode */
@media (prefers-color-scheme: dark) {
  body { background: #0b1220; color: #e5e7eb; }
  h2 { color: #9cdce2; }
  p.lead { color: #9aa4b2; }
  .card { background: #0f182a; box-shadow: 0 10px 25px rgba(0,0,0,.6); }
  .muted, .small { color: #9aa4b2; }
  .pill { background: #164e63; color: #e0f2f1; }
  .section-title .dot { background: var(--accent); }
  .profile .name { color: #e5e7eb; }
  .profile .line { color: #9aa4b2; }
  .q { border-bottom-color: #1f2937; }
  .scale label { border-color: #1f2937; background: #0f182a; color: #e5e7eb; }
  .scale label:has(input:checked) { background: rgb(42,121,130); color: #ffffff; border-color: rgb(42,121,130); }
  .sticky-footer { background: rgba(15,24,42,.92); border-top-color: #1f2937; }
  button.primary:disabled { background: #475569; opacity: 0.5; }
  button.secondary { background: rgba(20,83,90,.25); color: #9dd6db; border-color: rgba(45,158,171,.35); }
  .result { background: rgba(20,83,90,.25); border-color: rgba(45,158,171,.40); }
  .tag { background: rgba(20,83,90,.25); border-color: rgba(45,158,171,.40); color: #cde9ec; }
  .divider { background: #1f2937; }
  :root { --logo-color: #ffffff; }
  .progress-pill{ background: rgba(20,83,90,.25); border-color: rgba(45,158,171,.35); }
  .progress-pill .bar{ background: rgba(45,158,171,.45); }
  .progress-pill .text{ color:#cde9ec; }
  .sticky-header{ background: rgba(15,24,42,.92); border-bottom-color:#1f2937; }
  .sticky-header .progress-pill{ background: rgba(20,83,90,.25); border-color: rgba(45,158,171,.35); }
  .profile-choice:hover { background: rgba(255, 255, 255, 0.2); }
  /* Override inline-styled inputs/selects from light defaults */
  input[type="text"], input[type="email"], select {
    background: #0f182a !important;
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
  }
  /* Phone input dark mode */
  #phone {
    border-bottom-color: #1f2937 !important;
    color: #e5e7eb !important;
  }
  #phone:focus {
    border-bottom-color: var(--accent) !important;
  }
  #phone::placeholder {
    color: #64748b !important;
  }
  /* Links in phone step dark mode */
  #phone-step a {
    color: #9aa4b2 !important;
  }
  #phone-step a:hover {
    color: #cbd5e1 !important;
  }
}

