/* Lesson Plan Store — storefront + store chrome styles.
   Loaded on /store/* pages (via store_base.html) and on generator pages
   viewed by an external store customer (via base.html). */

:root {
  --store-blue: #101a3d;
  --store-royal: #1f3a6e;
  --store-gold: #d4a017;
  --store-gold-soft: #f6e7b8;
  --store-ink: #1c2537;
  --store-muted: #5a6478;
  --store-line: #dfe5f1;
  --store-bg: #f4f6fb;
  --store-ok: #15803d;
  --store-bad: #b91c1c;
}

* { box-sizing: border-box; }

/* ------------------------------------------------ public store layout */
.store-body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--store-bg);
  color: var(--store-ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.store-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 14px clamp(16px, 5vw, 54px);
  background: var(--store-blue);
  color: #fff;
}
.store-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.store-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--store-gold); color: var(--store-blue);
  font-weight: 800; display: flex; align-items: center; justify-content: center;
  letter-spacing: .5px;
}
.store-brand b { display: block; font-size: .98rem; letter-spacing: .4px; }
.store-brand small { display: block; font-size: .72rem; color: #c6d0e8; }

.store-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.store-nav a {
  color: #dbe3f5; text-decoration: none; font-size: .9rem; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
}
.store-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.store-nav a.store-btn {
  background: var(--store-gold); color: var(--store-blue);
}
.store-nav a.store-btn:hover { background: #e5b62e; }

.store-flashes, .store-main .flash, .flash { max-width: 1080px; width: calc(100% - 32px); margin: 0 auto; }

.store-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 26px 16px 40px; }

.store-foot {
  padding: 18px; text-align: center; color: var(--store-muted);
  font-size: .8rem; border-top: 1px solid var(--store-line); background: #fff;
}

/* flashes (local to store pages; school theme styles its own .flash) */
.store-body .flash, .store-shell .flash {
  border-radius: 10px; padding: 12px 16px; margin: 14px auto; font-size: .92rem;
  border: 1px solid var(--store-line); background: #fff;
}
.store-body .flash-ok, .store-shell .flash-ok { border-color: #bbf7d0; background: #f0fdf4; color: var(--store-ok); }
.store-body .flash-error, .store-shell .flash-error { border-color: #fecaca; background: #fef2f2; color: var(--store-bad); }
.store-body .flash-warn, .store-shell .flash-warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.store-body .flash-info, .store-shell .flash-info { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }

/* ------------------------------------------------ hero / public page */
.store-hero {
  background: linear-gradient(140deg, var(--store-blue) 0%, var(--store-royal) 70%, #2c4d8f 100%);
  color: #fff; text-align: center; padding: clamp(38px, 7vw, 74px) 18px;
}
.store-hero h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 4.4vw, 2.7rem); line-height: 1.15; }
.store-hero p { max-width: 640px; margin: 0 auto 26px; color: #d7def0; font-size: 1.02rem; }
.store-hero .store-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.store-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--store-gold); color: var(--store-blue) !important;
  font-weight: 700; padding: 13px 26px; border-radius: 10px;
  text-decoration: none; font-size: 1rem; border: 0; cursor: pointer;
}
.store-cta:hover { background: #e5b62e; }
.store-cta.secondary {
  background: rgba(255,255,255,.12); color: #fff !important;
  border: 1px solid rgba(255,255,255,.35);
}
.store-cta.secondary:hover { background: rgba(255,255,255,.22); }

.store-section { max-width: 1080px; margin: 0 auto; padding: 42px 16px 8px; }
.store-section h2 { text-align: center; margin: 0 0 6px; font-size: 1.45rem; }
.store-section .store-sub { text-align: center; color: var(--store-muted); margin: 0 0 26px; }

.store-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.store-step {
  background: #fff; border: 1px solid var(--store-line); border-radius: 14px;
  padding: 20px 18px;
}
.store-step .num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--store-royal);
  color: #fff; font-weight: 800; display: flex; align-items: center;
  justify-content: center; margin-bottom: 12px;
}
.store-step h3 { margin: 0 0 6px; font-size: 1rem; }
.store-step p { margin: 0; color: var(--store-muted); font-size: .88rem; line-height: 1.5; }
.store-step b { color: var(--store-ink); }

/* pricing */
.store-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.store-price {
  background: #fff; border: 2px solid var(--store-line); border-radius: 14px;
  padding: 22px 16px; text-align: center;
}
.store-price.hot { border-color: var(--store-gold); box-shadow: 0 6px 18px rgba(212,160,23,.18); }
.store-price .p-label { font-weight: 700; font-size: 1.02rem; }
.store-price .p-amount { font-size: 1.5rem; font-weight: 800; color: var(--store-royal); margin: 8px 0 4px; }
.store-price .p-note { color: var(--store-muted); font-size: .8rem; }

.store-payband {
  margin-top: 26px; background: var(--store-blue); color: #fff;
  border-radius: 14px; padding: 18px 22px; display: flex; flex-wrap: wrap;
  gap: 14px; align-items: center; justify-content: space-between;
}
.store-payband .pb-item { font-size: .94rem; }
.store-payband .pb-item small { color: #b9c4e0; display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; }
.store-payband .pb-item b { font-size: 1.06rem; }

/* ------------------------------------------------ auth cards */
.store-auth { max-width: 430px; margin: 34px auto; }
.store-card {
  background: #fff; border: 1px solid var(--store-line); border-radius: 16px;
  padding: 26px 24px; box-shadow: 0 4px 16px rgba(16,26,61,.06);
}
.store-card h1 { margin: 0 0 4px; font-size: 1.35rem; }
.store-card .store-lead { color: var(--store-muted); font-size: .9rem; margin: 0 0 18px; }

.store-field { margin-bottom: 14px; }
.store-field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.store-field input, .store-field select, .store-field textarea {
  width: 100%; border: 1.5px solid var(--store-line); border-radius: 9px;
  padding: 11px 12px; font-size: .95rem; font-family: inherit; background: #fff;
}
.store-field input:focus, .store-field select:focus, .store-field textarea:focus {
  outline: 0; border-color: var(--store-royal); box-shadow: 0 0 0 3px rgba(31,58,110,.12);
}
.store-field .hint { font-size: .78rem; color: var(--store-muted); margin-top: 4px; }

.store-submit {
  width: 100%; background: var(--store-royal); color: #fff; border: 0;
  border-radius: 10px; padding: 13px; font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.store-submit:hover { background: #274a8a; }
.store-submit.gold { background: var(--store-gold); color: var(--store-blue); }
.store-submit.gold:hover { background: #e5b62e; }
.store-submit:disabled { opacity: .55; cursor: not-allowed; }

.store-alt { text-align: center; font-size: .88rem; color: var(--store-muted); margin-top: 16px; }
.store-alt a { color: var(--store-royal); font-weight: 600; }

.store-divider {
  display: flex; align-items: center; gap: 10px; color: var(--store-muted);
  font-size: .78rem; margin: 18px 0; text-transform: uppercase; letter-spacing: 1px;
}
.store-divider::before, .store-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--store-line);
}

.store-google {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; background: #fff; border: 1.5px solid var(--store-line);
  border-radius: 10px; padding: 12px; font-size: .95rem; font-weight: 600;
  color: #3c4043; text-decoration: none; cursor: pointer; font-family: inherit;
}
.store-google:hover { border-color: #b8c2d8; background: #f8faff; }
.store-google svg { flex: none; }

/* ------------------------------------------------ dashboard */
.store-dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.store-dash-head h1 { margin: 0; font-size: 1.5rem; }
.store-dash-head .who { color: var(--store-muted); font-size: .88rem; }

.sub-pill {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px;
  padding: 8px 16px; font-weight: 700; font-size: .88rem;
}
.sub-pill.active { background: #f0fdf4; color: var(--store-ok); border: 1.5px solid #bbf7d0; }
.sub-pill.inactive { background: #fff7ed; color: #c2410c; border: 1.5px solid #fed7aa; }
.sub-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.store-grid .store-card h2 { margin: 0 0 4px; font-size: 1.08rem; }
.store-grid .store-card .store-lead { margin-bottom: 14px; }

.gen-buttons { display: grid; gap: 10px; }
.gen-btn {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  border: 2px solid var(--store-line); border-radius: 12px; padding: 14px 16px;
  color: var(--store-ink); background: #fff; transition: border-color .15s;
}
.gen-btn .g-ico { font-size: 1.5rem; }
.gen-btn b { display: block; font-size: .98rem; }
.gen-btn small { color: var(--store-muted); font-size: .8rem; }
.gen-btn:hover { border-color: var(--store-royal); }
.gen-btn.locked { opacity: .55; pointer-events: none; background: #f6f8fc; }

.code-input {
  width: 100%; border: 1.5px solid var(--store-line); border-radius: 10px;
  padding: 14px; font-size: 1.15rem; text-align: center; letter-spacing: 2px;
  font-weight: 700; text-transform: uppercase; font-family: inherit;
}
.code-input:focus { outline: 0; border-color: var(--store-gold); box-shadow: 0 0 0 3px rgba(212,160,23,.18); }

.store-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.store-table th, .store-table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--store-line); vertical-align: top; }
.store-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; color: var(--store-muted); }
.store-table tr:last-child td { border-bottom: 0; }
.store-table .mono { font-family: ui-monospace, 'Courier New', monospace; font-weight: 700; letter-spacing: .5px; }

.pill { display: inline-block; border-radius: 999px; padding: 3px 11px; font-size: .76rem; font-weight: 700; }
.pill.active { background: #dcfce7; color: #166534; }
.pill.unused { background: #e0e7ff; color: #3730a3; }
.pill.expired { background: #f1f5f9; color: #64748b; }
.pill.revoked { background: #fee2e2; color: #991b1b; }

/* ------------------------------------------------ store chrome (generators) */
.store-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--store-bg); }
.store-shell .store-top { position: sticky; top: 0; z-index: 30; }
.store-subbar {
  background: #fff; border-bottom: 1px solid var(--store-line);
  padding: 9px clamp(16px, 5vw, 54px); font-size: .85rem; color: var(--store-muted);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.store-subbar b { color: var(--store-ink); }
.store-subbar .until-ok { color: var(--store-ok); font-weight: 700; }
.store-shell .store-main { max-width: 1160px; }
.store-shell .foot { text-align: center; color: var(--store-muted); font-size: .78rem; padding: 22px 10px; }

@media (max-width: 620px) {
  .store-nav a { padding: 7px 9px; font-size: .84rem; }
  .store-table th:nth-child(4), .store-table td:nth-child(4) { display: none; }
}
