:root {
  --blue-950: #081936;
  --blue-900: #10264f;
  --blue-700: #244c93;
  --marian: #2d65c8;
  --gold: #cba34b;
  --gold-soft: #f3e2b8;
  --cream: #fffaf0;
  --paper: #fffdf8;
  --ink: #172033;
  --muted: #667085;
  --line: rgba(24, 35, 61, 0.12);
  --shadow: 0 22px 70px rgba(8, 25, 54, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(203, 163, 75, 0.2), transparent 32rem),
    linear-gradient(135deg, #f7f0df 0%, #f6f8ff 45%, #edf4ff 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 68px);
  background: rgba(255, 250, 240, 0.82);
  border-bottom: 1px solid rgba(203, 163, 75, 0.2);
  backdrop-filter: blur(18px);
}

.brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--cream);
  background: linear-gradient(145deg, var(--blue-900), var(--marian));
  border: 1px solid rgba(203, 163, 75, 0.55);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12);
  font-family: Cinzel, serif;
  font-weight: 700;
}

.brand strong,
.sidebar-brand strong {
  display: block;
  font-family: Cinzel, serif;
  font-size: 1.18rem;
  letter-spacing: 0.02em;
}

.brand small,
.sidebar-brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.public-nav a {
  color: var(--blue-900);
  font-weight: 600;
  text-decoration: none;
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  color: var(--blue-900);
  font-size: 1.6rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.logout-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--blue-900), var(--marian));
  box-shadow: 0 12px 26px rgba(36, 76, 147, 0.25);
}

.secondary-button,
.ghost-button {
  color: var(--blue-900);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.logout-button:hover {
  transform: translateY(-1px);
}

.large {
  padding: 14px 22px;
  font-size: 1rem;
}

.full {
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 28px;
  min-height: calc(100vh - 82px);
  padding: clamp(28px, 6vw, 76px);
  align-items: center;
  background:
    linear-gradient(rgba(8, 25, 54, 0.62), rgba(8, 25, 54, 0.42)),
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.58), transparent 10rem),
    linear-gradient(135deg, var(--blue-950), #173c7a 46%, #e9d18e);
  color: white;
  overflow: hidden;
  position: relative;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
}

.hero::before {
  right: 8%;
  top: 12%;
  width: 330px;
  height: 330px;
  border: 2px solid rgba(243, 226, 184, 0.34);
  border-radius: 50% 50% 45% 45%;
  box-shadow: inset 0 0 0 22px rgba(255, 255, 255, 0.04);
}

.hero::after {
  left: 55%;
  bottom: -80px;
  width: 420px;
  height: 420px;
  background: repeating-conic-gradient(from 18deg, rgba(255, 255, 255, 0.12) 0 8deg, rgba(203, 163, 75, 0.14) 8deg 13deg);
  border-radius: 50%;
  opacity: 0.38;
}

.hero-glass,
.prayer-card {
  position: relative;
  z-index: 1;
}

.hero-glass {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: Cinzel, serif;
  font-size: clamp(3.6rem, 10vw, 8.4rem);
  line-height: 0.92;
}

.hero-subtitle {
  max-width: 720px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.12rem, 2.2vw, 1.55rem);
  line-height: 1.6;
}

.hero-actions,
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hero-stats {
  color: rgba(255, 255, 255, 0.78);
}

.hero-stats span {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
}

.hero-stats strong {
  color: var(--gold-soft);
}

.prayer-card,
.auth-card,
.dashboard-card,
.content-card,
.feature-grid article {
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(203, 163, 75, 0.24);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.prayer-card {
  padding: 28px;
  color: var(--ink);
}

.card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 22px;
  color: var(--blue-900);
  background: var(--gold-soft);
  border-radius: 50%;
}

.prayer-card h2,
.section h2 {
  margin: 0;
  font-family: Cinzel, serif;
}

.prayer-card p,
.section p,
.feature-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.text-button {
  padding: 0;
  color: var(--marian);
  background: transparent;
  border: 0;
  font-weight: 800;
}

.text-button.muted {
  color: var(--muted);
}

.section {
  max-width: 980px;
  padding: 80px clamp(22px, 7vw, 86px) 36px;
}

.section h2 {
  max-width: 820px;
  color: var(--blue-950);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.12;
}

.section p {
  max-width: 760px;
  font-size: 1.08rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 24px clamp(22px, 7vw, 86px) 92px;
}

.feature-grid article {
  padding: 24px;
  box-shadow: 0 14px 36px rgba(8, 25, 54, 0.08);
}

.feature-grid span {
  color: var(--gold);
  font-family: Cinzel, serif;
  font-weight: 700;
}

.feature-grid h3 {
  margin: 14px 0 10px;
  color: var(--blue-900);
}

.auth-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(8, 25, 54, 0.68);
  backdrop-filter: blur(10px);
}

.auth-card {
  position: relative;
  width: min(100%, 460px);
  padding: 34px;
}

.auth-card h2 {
  margin: 0;
  color: var(--blue-950);
  font-family: Cinzel, serif;
  font-size: 2rem;
}

.auth-card p {
  color: var(--muted);
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  color: var(--blue-900);
  background: #f5f0e5;
  border: 0;
  border-radius: 50%;
  font-size: 1.4rem;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--blue-900);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(45, 101, 200, 0.55);
  box-shadow: 0 0 0 4px rgba(45, 101, 200, 0.1);
}

.form-message {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--blue-700) !important;
  font-weight: 700;
}

.private-app {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(135deg, #fffaf0, #edf4ff);
}

.private-app + .topbar,
.private-app ~ .topbar {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  color: white;
  background:
    linear-gradient(rgba(8, 25, 54, 0.96), rgba(8, 25, 54, 0.92)),
    radial-gradient(circle at top, rgba(203, 163, 75, 0.35), transparent 18rem);
}

.sidebar .brand-mark {
  background: linear-gradient(145deg, var(--gold), #f4df9a);
  color: var(--blue-950);
}

.sidebar small {
  color: rgba(255, 255, 255, 0.66);
}

.sidebar nav {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 13px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  font-weight: 800;
}

.nav-button.active,
.nav-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(203, 163, 75, 0.26);
}

.logout-button {
  margin-top: auto;
  color: var(--blue-950);
  background: var(--gold-soft);
}

.content-panel {
  min-width: 0;
  padding: clamp(22px, 4vw, 46px);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  color: var(--blue-950);
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.page-head p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-grid,
.library-grid,
.progress-grid,
.rosary-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, 1fr);
}

.dashboard-card,
.content-card {
  padding: 22px;
  border-radius: 20px;
  box-shadow: 0 16px 42px rgba(8, 25, 54, 0.08);
}

.dashboard-card.wide {
  grid-column: span 2;
}

.dashboard-card h3,
.content-card h3 {
  margin: 0 0 10px;
  color: var(--blue-900);
}

.dashboard-card p,
.content-card p,
.content-card li {
  color: var(--muted);
  line-height: 1.65;
}

.kpi {
  display: block;
  color: var(--blue-950);
  font-family: Cinzel, serif;
  font-size: 2.2rem;
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.small-button {
  padding: 9px 12px;
  color: var(--blue-900);
  background: #f8f3e8;
  border: 1px solid rgba(203, 163, 75, 0.28);
  border-radius: 999px;
  font-weight: 800;
}

.small-button.active {
  color: white;
  background: var(--blue-900);
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-bottom: 20px;
}

.library-grid {
  grid-template-columns: repeat(3, 1fr);
}

.content-card {
  position: relative;
}

.content-card .tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  color: var(--blue-900);
  background: #edf4ff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.prayer-text {
  padding: 24px;
  background: linear-gradient(180deg, #fffdf8, #fff8e9);
  border: 1px solid rgba(203, 163, 75, 0.22);
  border-radius: 18px;
  color: #283247;
  font-size: 1.08rem;
  line-height: 1.9;
  white-space: pre-line;
}

.day-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.day-card.complete {
  border-color: rgba(36, 76, 147, 0.34);
  background: linear-gradient(180deg, #f4f8ff, #fffdf8);
}

.rosary-counter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 9px;
  margin: 18px 0;
}

.bead {
  aspect-ratio: 1;
  border: 1px solid rgba(203, 163, 75, 0.44);
  border-radius: 50%;
  background: #fff8e9;
}

.bead.done {
  background: linear-gradient(135deg, var(--blue-900), var(--marian));
}

.progress-grid,
.rosary-grid {
  grid-template-columns: repeat(2, 1fr);
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  background: #ece7dc;
  border-radius: 999px;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-900), var(--gold));
}

.note-box {
  margin-top: 14px;
}

.access-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.access-pill.unlocked {
  color: #12351f;
  background: #dff6e6;
  border: 1px solid rgba(34, 122, 62, 0.22);
}

.access-pill.locked {
  color: var(--blue-950);
  background: var(--gold-soft);
  border: 1px solid rgba(203, 163, 75, 0.34);
}

.access-status-card,
.premium-lock-card {
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.94), rgba(239, 246, 255, 0.94)),
    radial-gradient(circle at top right, rgba(203, 163, 75, 0.24), transparent 16rem);
}

.price-highlight {
  display: block;
  margin: 18px 0 8px;
  color: var(--blue-950);
  font-family: Cinzel, serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
}

.muted-line {
  color: var(--muted);
  font-size: 0.92rem;
}

.premium-lock-card ul {
  margin: 18px 0;
  padding-left: 20px;
}

.premium-lock-card li {
  margin: 8px 0;
}

@media (max-width: 1080px) {
  .feature-grid,
  .dashboard-grid,
  .library-grid,
  .day-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .public-nav {
    position: absolute;
    top: 74px;
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    background: rgba(255, 253, 248, 0.98);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .public-nav.open {
    display: flex;
  }

  .menu-button {
    display: block;
  }

  .hero {
    min-height: auto;
    padding: 52px 22px;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .feature-grid,
  .dashboard-grid,
  .library-grid,
  .day-list,
  .progress-grid,
  .rosary-grid,
  .library-toolbar {
    grid-template-columns: 1fr;
  }

  .private-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .dashboard-card.wide {
    grid-column: auto;
  }

  .page-head {
    display: grid;
  }
}
