/* ==========================================================================
   Lins Medcare — 30-Day No Soda Challenge
   "Health Talk With Nurse Collins"
   ========================================================================== */

:root {
  /* Brand colors (Lins Medcare) */
  --brand-blue:        #2a79c7;
  --brand-blue-mid:     #1d5c9c;
  --brand-blue-deep:    #0c2c4e;
  --brand-ice:          #e2f8ff;
  --white:              #ffffff;

  /* Derived neutrals */
  --ink:                #0c2438;
  --ink-soft:            rgba(12, 36, 56, 0.62);
  --ink-faint:           rgba(12, 36, 56, 0.38);

  /* Functional colors */
  --success:            #1f9d6c;
  --success-soft:       rgba(31, 157, 108, 0.16);
  --locked:             rgba(255, 255, 255, 0.30);

  /* Glass surfaces */
  --glass-fill:         rgba(255, 255, 255, 0.14);
  --glass-fill-strong:  rgba(255, 255, 255, 0.22);
  --glass-border:       rgba(255, 255, 255, 0.38);
  --glass-fill-light:   rgba(255, 255, 255, 0.65);
  --glass-border-light: rgba(255, 255, 255, 0.80);

  /* Type */
  --font-display: "Poppins", "Inter", sans-serif;
  --font-body:    "Inter", "Poppins", sans-serif;

  /* Spacing / radius */
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1160px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Animated brand gradient backdrop ---------- */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,0.10), transparent 42%),
    radial-gradient(circle at 85% 18%, rgba(226,248,255,0.20), transparent 45%),
    linear-gradient(160deg, var(--brand-blue-deep) 0%, var(--brand-blue-mid) 38%, var(--brand-blue) 62%, #6fb8e8 82%, var(--brand-ice) 100%);
  background-size: 140% 140%;
  animation: drift 22s ease-in-out infinite alternate;
}
.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.5) 1px, transparent 1.6px);
  background-size: 26px 26px;
  opacity: 0.06;
}
@keyframes drift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 18px 50px rgba(8, 28, 48, 0.25);
}
.glass-light {
  background: var(--glass-fill-light);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 10px 30px rgba(8, 28, 48, 0.12);
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 5;
  padding: 22px 0 4px;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 30px; width: auto; }
.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-meta .eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  font-weight: 600;
}
.brand-meta .sub {
  font-size: 12.5px;
  color: rgba(255,255,255,0.92);
  font-weight: 500;
}
.header-pill {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--white);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 16px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 2;
  padding: 28px 0 64px;
}
.hero-card {
  padding: 48px 40px 40px;
  text-align: center;
  color: var(--white);
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.8s var(--ease) forwards;
  animation-delay: 0.05s;
}
.hero-eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-ice);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.01em;
}
.hero h1 span { color: var(--brand-ice); }
.hero-dates {
  margin-top: 16px;
  font-size: 15.5px;
  color: rgba(255,255,255,0.86);
  font-weight: 500;
}
.hero-dates strong { color: var(--white); font-weight: 700; }

/* Countdown / Day tracker */
.tracker {
  margin: 36px auto 0;
  max-width: 760px;
}
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tracker-cell {
  padding: 18px 8px 16px;
  border-radius: var(--radius-md);
}
.tracker-cell .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--white);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tracker-cell .lbl {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
}

.day-mode {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 26px 30px;
  border-radius: var(--radius-md);
}
.day-mode.is-active { display: flex; }
.day-mode .day-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 64px);
  color: var(--white);
  line-height: 1;
}
.day-mode .day-meta {
  text-align: left;
}
.day-mode .day-meta .lbl {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-ice);
  font-weight: 700;
}
.day-mode .day-meta .desc {
  margin-top: 4px;
  font-size: 15px;
  color: rgba(255,255,255,0.88);
  font-weight: 500;
}

/* Pulse / progress signature */
.pulse-wrap {
  margin-top: 28px;
}
.pulse-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pulse-row .count { color: var(--white); font-weight: 700; }
.pulse-svg {
  width: 100%;
  height: 34px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
}
.pulse-track { stroke: rgba(255,255,255,0.30); }
.pulse-fill  { stroke: var(--brand-ice); transition: none; }

/* ---------- Section heading ---------- */
.section-head {
  text-align: center;
  margin-bottom: 28px;
  color: var(--white);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 32px);
}
.section-head p {
  margin-top: 8px;
  color: rgba(255,255,255,0.82);
  font-size: 14.5px;
}

/* ---------- Day grid ---------- */
.grid-section {
  position: relative;
  z-index: 2;
  padding: 6px 0 70px;
}
.day-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.day-card {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--white);
  cursor: pointer;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), background 0.28s var(--ease);
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.6s var(--ease) forwards;
}
.day-card:hover:not(.is-locked) {
  transform: translateY(-4px) scale(1.035);
  box-shadow: 0 20px 40px rgba(6, 22, 40, 0.35);
}
.day-card .d-icon { font-size: 16px; color: rgba(255,255,255,0.85); }
.day-card .d-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
}
.day-card .d-label {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

.day-card.is-locked {
  cursor: not-allowed;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.45);
}
.day-card.is-locked .d-icon,
.day-card.is-locked .d-label { color: rgba(255,255,255,0.40); }

.day-card.is-current {
  border-color: var(--brand-ice);
  box-shadow: 0 0 0 0 rgba(226,248,255,0.55);
  animation: rise 0.6s var(--ease) forwards, pulseRing 2.4s ease-out infinite;
}
.day-card.is-current::before {
  content: "TODAY";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-ice);
  color: var(--brand-blue-deep);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
}

.day-card.is-complete {
  background: linear-gradient(160deg, rgba(31,157,108,0.30), rgba(255,255,255,0.10));
  border-color: rgba(31,157,108,0.55);
}
.day-card.is-complete .check-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--white);
}

@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(226,248,255,0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(226,248,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,248,255,0); }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 18, 32, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease);
}
.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 36px 32px 30px;
  color: var(--white);
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.modal-overlay.is-open .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.30);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.modal-close:hover { background: rgba(255,255,255,0.28); }
.modal-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-ice);
}
.modal-eyebrow .modal-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.modal-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  margin-top: 14px;
  line-height: 1.25;
}
.modal-date {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}
.modal-tip {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,0.92);
}
.modal-action {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  border-left: 3px solid var(--brand-ice);
}
.modal-action .a-lbl {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-ice);
}
.modal-action p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
}
.modal-footer {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-complete {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--white);
  color: var(--brand-blue-deep);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-complete:hover { transform: translateY(-1px); }
.btn-complete.is-done {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.modal-progress-note {
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
}

body.modal-locked { overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 38px 0 36px;
}
.footer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 26px 30px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-brand img { height: 26px; width: auto; }
.footer-brand .f-meta { line-height: 1.3; }
.footer-brand .f-meta .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
}
.footer-brand .f-meta .tag {
  font-size: 12px;
  color: var(--ink-soft);
}
.footer-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  max-width: 360px;
  text-align: right;
  line-height: 1.5;
}

/* ---------- Motion ---------- */
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .app-bg { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .day-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 760px) {
  .tracker-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .tracker-cell { padding: 14px 6px 12px; }
  .day-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .hero-card { padding: 36px 22px 30px; }
  .day-mode { flex-direction: column; gap: 8px; text-align: center; padding: 24px 20px; }
  .day-mode .day-meta { text-align: center; }
  .footer-card { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-note { text-align: left; }
}
@media (max-width: 520px) {
  .day-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .day-card .d-num { font-size: 18px; }
  .day-card .d-icon { font-size: 13px; }
  .header-pill { display: none; }
  .brand-meta .eyebrow { font-size: 10px; }
}
@media (max-width: 380px) {
  .day-grid { grid-template-columns: repeat(3, 1fr); }
  .wrap { padding: 0 16px; }
}

/* ---------- Auth Form Styles ---------- */
.auth-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.auth-input::placeholder {
  color: var(--ink-faint);
}

.auth-input:focus {
  border-color: var(--brand-blue);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--success-soft);
}