/* codes.realquick.app - dark-first, mobile-first. No framework. */

:root {
  --bg: #0a0c10;
  --bg-glow: #10151d;
  --surface: #14171d;
  --surface-2: #1b1f28;
  --border: #262b35;
  --border-soft: #1e232c;
  --text: #e9edf3;
  --muted: #98a2b3;
  --faint: #6b7482;
  --accent: #3ddc84;
  --accent-dim: #2bb96a;
  --accent-ink: #05130b;
  --warn: #f5b544;
  --danger: #f4667c;
  --info: #6aa6ff;

  /* Makes native controls - file button, date picker, scrollbars - dark too. */
  color-scheme: dark;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .28);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(900px 420px at 50% -160px, rgba(61, 220, 132, .10), transparent 70%),
    radial-gradient(700px 380px at 100% 0, rgba(106, 166, 255, .06), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 940px; margin: 0 auto; padding: 0 18px; }
.narrow { max-width: 640px; }
/* The admin listings table has far more columns than any public page. */
.wide { max-width: 1320px; }

/* --- Header / footer ---------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 16, .82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.navbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }

.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #1e9c58);
  color: var(--accent-ink); font-size: 14px; font-weight: 800;
}
.logo-dim { color: var(--faint); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links .btn { white-space: nowrap; }
/* On a phone the header has room for one action; "How it works" also lives in
   the footer and on every empty state. */
@media (max-width: 560px) {
  .nav-links .btn-ghost { display: none; }
}

main { flex: 1 0 auto; padding: 26px 0 56px; }

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 22px 0;
  color: var(--faint);
  font-size: .84rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit; font-weight: 600; font-size: .93rem;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; background: #232833; border-color: #333a47; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 6px 18px rgba(61, 220, 132, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, #55e695, var(--accent)); }
.btn-lg { width: 100%; padding: 15px 22px; font-size: 1.02rem; border-radius: 14px; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: .82rem; }
.btn-danger { color: var(--danger); border-color: #3a2830; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* --- Cards / surfaces --------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }

.hero { padding: 12px 0 26px; }
.hero h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); margin-bottom: .35em; }
.hero p { color: var(--muted); font-size: 1.02rem; max-width: 46ch; margin-bottom: 0; }
.hero-stat { color: var(--accent); font-weight: 650; }

/* --- Badges ------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .73rem; font-weight: 650; letter-spacing: .01em;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.badge-verified { color: var(--accent); border-color: rgba(61, 220, 132, .3); background: rgba(61, 220, 132, .09); }
.badge-unverified { color: var(--warn); border-color: rgba(245, 181, 68, .28); background: rgba(245, 181, 68, .08); }
.badge-iap { color: var(--info); border-color: rgba(106, 166, 255, .28); background: rgba(106, 166, 255, .08); }
.badge-gone { color: var(--faint); }

/* --- Campaign grid ------------------------------------------------------ */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 30px 0 14px;
}
.section-head h2 { margin: 0; }
.section-head .hint { color: var(--faint); font-size: .84rem; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }

.app-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  transition: border-color .15s ease, transform .1s ease;
}
.app-card:hover { text-decoration: none; border-color: #3a4150; transform: translateY(-2px); }
.app-card.is-gone { opacity: .62; }

.app-head { display: flex; gap: 12px; align-items: flex-start; }
.app-icon {
  width: 54px; height: 54px; flex: none;
  border-radius: 13px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border);
}
.app-icon-fallback { display: grid; place-items: center; font-size: 1.3rem; color: var(--faint); }
.app-title { font-weight: 650; font-size: 1.02rem; line-height: 1.3; }
.app-dev { color: var(--faint); font-size: .84rem; }
.app-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

.meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); }
.meter-row { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.meter-row strong { color: var(--text); font-weight: 650; }

.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 34px 20px; text-align: center; color: var(--muted);
}

/* --- Campaign detail ---------------------------------------------------- */

.detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.detail-head .app-icon { width: 76px; height: 76px; border-radius: 18px; }
.detail-head h1 { font-size: clamp(1.35rem, 5vw, 1.8rem); margin-bottom: .15em; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 10px; text-align: center;
}
.stat b { display: block; font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; }
.stat span { display: block; color: var(--faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.stat-accent b { color: var(--accent); }

.claim-panel { border-color: #2c3340; }
.claim-panel h2 { margin-bottom: .35em; }

.countdown {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-weight: 650;
  color: var(--text);
}

.notice {
  display: flex; gap: 11px; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 13px 14px;
  font-size: .92rem; border: 1px solid var(--border); background: var(--surface-2);
  margin-bottom: 14px;
}
.notice p:last-child { margin-bottom: 0; }
.notice-icon { flex: none; font-size: 1.05rem; line-height: 1.4; }
.notice-warn { border-color: rgba(245, 181, 68, .3); background: rgba(245, 181, 68, .07); }
.notice-error { border-color: rgba(244, 102, 124, .32); background: rgba(244, 102, 124, .08); }
.notice-good { border-color: rgba(61, 220, 132, .3); background: rgba(61, 220, 132, .07); }
.notice-info { border-color: rgba(106, 166, 255, .28); background: rgba(106, 166, 255, .07); }

.code-block {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-glow); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 14px; margin-bottom: 10px;
}
.code-value {
  font-family: var(--mono); font-size: 1.02rem; font-weight: 600;
  letter-spacing: .04em; word-break: break-all; flex: 1; color: var(--accent);
}
.copy-btn { flex: none; }
.copy-btn.copied { color: var(--accent); border-color: rgba(61, 220, 132, .4); }

.shots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.shots img {
  height: 300px; border-radius: 12px; border: 1px solid var(--border);
  scroll-snap-align: start; flex: none; background: var(--surface-2);
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding-left: 34px; margin-bottom: 11px; color: var(--muted); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: .76rem; font-weight: 700; color: var(--text);
}
.steps strong { color: var(--text); }

.qr { display: grid; place-items: center; padding: 18px; background: #fff; border-radius: 14px; width: fit-content; margin: 0 auto 14px; }
.qr svg { display: block; }

/* --- Forms -------------------------------------------------------------- */

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field .help { color: var(--faint); font-size: .82rem; margin: 6px 0 0; }

input[type='text'], input[type='url'], input[type='number'], input[type='date'], input[type='file'], select, textarea {
  width: 100%;
  padding: 12px 13px;
  background: var(--bg-glow);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* keeps iOS/Android from zooming on focus */
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(61, 220, 132, .45); outline-offset: 1px; border-color: transparent; }
input[type='file'] { padding: 9px; }
input[type='file']::file-selector-button {
  margin-right: 11px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
}
input[type='file']::file-selector-button:hover { background: #232833; }
input::placeholder { color: #545c69; }

.radio-row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .radio-row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 700px) { .radio-row-3 { grid-template-columns: repeat(3, 1fr); } }

.consent {
  display: flex; gap: 11px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-glow); padding: 14px;
  margin-bottom: 18px; cursor: pointer;
}
.consent input { margin: 3px 0 0; accent-color: var(--accent); flex: none; width: 17px; height: 17px; }
.consent span { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.consent:has(input:checked) { border-color: rgba(61, 220, 132, .4); }
.radio-card {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px; cursor: pointer; background: var(--bg-glow);
}
.radio-card input { margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.radio-card:has(input:checked) { border-color: var(--accent); background: rgba(61, 220, 132, .06); }
.radio-card b { display: block; font-size: .93rem; color: var(--text); }
.radio-card span { color: var(--faint); font-size: .81rem; }
.radio-card > span { flex: 1; }

.two-col { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .two-col { grid-template-columns: 1fr 1fr; } }

.errors { list-style: none; padding: 0; margin: 0; }
.errors li { margin-bottom: 4px; }
.errors li:last-child { margin-bottom: 0; }

/* --- Tables (admin) ----------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 640px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
/* The app name is the only elastic column; cap it so the action buttons at the
   far right stay on screen without horizontal scrolling. */
td.app-cell { white-space: normal; max-width: 240px; }
td.actions { width: 1%; }
td.actions .btn { padding: 6px 11px; font-size: .78rem; }
th { color: var(--faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .018); }
td.wrap { white-space: normal; }

.mono { font-family: var(--mono); font-size: .86rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline; }

/* --- Cookie notice ------------------------------------------------------ */

body.consent-open { overflow: hidden; }

.consent-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5, 7, 10, .72);
  backdrop-filter: blur(4px);
  padding: 16px;
}
@media (min-width: 620px) { .consent-gate { align-items: center; } }

.consent-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  padding: 22px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.consent-dialog h2 { font-size: 1.2rem; }
.consent-dialog p { color: var(--muted); font-size: .92rem; }

.consent-actions { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 480px) { .consent-actions { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.consent-actions form { display: contents; }
.consent-actions .btn { width: 100%; }

/* --- Confirmations ------------------------------------------------------ */

.confirm-box {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-glow); padding: 15px; margin-top: 16px;
}
.confirm-box h3 { font-size: 1rem; margin-bottom: .3em; }
.confirm-box p { color: var(--muted); font-size: .86rem; }

.pips { display: flex; gap: 6px; margin: 12px 0; }
.pips span {
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.pips span.on { background: linear-gradient(90deg, var(--accent-dim), var(--accent)); border-color: transparent; }

/* --- Pagination --------------------------------------------------------- */

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.pager .current { color: var(--muted); font-size: .85rem; }

.admin-bar {
  background: rgba(244, 102, 124, .08);
  border: 1px solid rgba(244, 102, 124, .25);
  border-radius: var(--radius-sm);
  padding: 9px 13px; margin-bottom: 18px;
  font-size: .84rem; color: var(--danger);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
