/* Kupido — happy light theme, iPad sized */

:root {
    --bg: #FFF7EE;
    --bg-card: #FFFFFF;
    --bg-soft: #FFEFE0;
    --primary: #FF6B6B;
    --primary-dark: #E84F4F;
    --accent: #4ECDC4;
    --accent-dark: #36B5AC;
    --warn: #FFB74D;
    --danger: #E63946;
    --ok: #2A9D8F;
    --ink: #2D3142;
    --ink-soft: #5A6172;
    --ink-faint: #97A0B0;
    --line: #F1E1CE;
    --shadow: 0 8px 24px rgba(45, 49, 66, 0.08);
    --shadow-pop: 0 16px 40px rgba(45, 49, 66, 0.16);
    --radius: 24px;
    --radius-sm: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 19px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

body { min-height: 100vh; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1 { font-size: 2.6rem; margin: 0 0 0.4em; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.8rem; margin: 0 0 0.4em; font-weight: 700; }
h3 { font-size: 1.3rem; margin: 0 0 0.4em; font-weight: 700; }
p  { margin: 0 0 1em; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 28px 80px;
}
.container-narrow { max-width: 720px; }
.container-wide   { max-width: 1400px; }

/* Topbar */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 28px;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--line);
}
.topbar .brand {
    font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em;
    color: var(--ink);
    display: flex; align-items: center; gap: 0.5em;
}
.topbar .brand .heart { color: var(--primary); font-size: 1.4em; line-height: 1; }
.topbar .right { display: flex; gap: 12px; align-items: center; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 22px;
}

/* Buttons — BIG */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5em;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 18px 30px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 80ms ease, box-shadow 120ms ease, background 120ms;
    text-decoration: none;
    line-height: 1;
    min-height: 60px;
    font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(0.97); box-shadow: var(--shadow); }
.btn-big {
    font-size: 1.5rem;
    padding: 26px 44px;
    min-height: 80px;
}
.btn-huge {
    font-size: 2rem;
    padding: 32px 56px;
    min-height: 110px;
    border-radius: 28px;
}
.btn-secondary { background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: #FFE2C9; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn-ghost:hover { color: var(--ink); background: var(--bg-soft); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #B5293A; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* Forms */
label {
    display: block;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
    font-size: 1.05rem;
}
.hint { font-size: 0.95rem; color: var(--ink-soft); font-weight: 400; margin-top: -4px; margin-bottom: 14px; }

input[type=text], input[type=password], input[type=number], input[type=color],
input[type=email], textarea, select {
    width: 100%;
    padding: 16px 18px;
    font-size: 1.1rem;
    font-family: inherit;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    line-height: 1.3;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.18);
}
input[type=color] { padding: 8px; min-height: 60px; cursor: pointer; }

.field { margin-bottom: 18px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > * { flex: 1; min-width: 200px; }

.checkbox-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-soft);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    margin-bottom: 14px;
}
.checkbox-row input[type=checkbox] {
    width: 24px; height: 24px;
}

.radio-row {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.radio-row label {
    flex: 1;
    min-width: 120px;
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    margin: 0;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
}
.radio-row input[type=radio] { width: 22px; height: 22px; cursor: pointer; }
.radio-row label:has(input:checked) {
    background: #DEF7EE;
    border-color: var(--accent);
}

.file-drop {
    border: 2px dashed var(--line);
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
}
/* Visually hidden but still focusable (so HTML5 validation can target it) */
.file-drop input[type=file] {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}
.file-drop .file-label { font-weight: 700; color: var(--ink-soft); }
.file-drop.has-file { background: #E6F8F4; border-color: var(--accent); }
.file-drop img { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); margin-top: 10px; }

/* Pills / chips */
.pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--bg-soft);
    color: var(--ink-soft);
    margin-right: 6px;
}
.pill-pending  { background: #FFF1D6; color: #B07A1A; }
.pill-approved { background: #DEF7EE; color: #1B7A57; }
.pill-rejected { background: #FBE0E3; color: #9A2331; }

/* Status banner / cost meter */
.cost-meter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    font-weight: 700;
    color: var(--ink-soft);
    font-size: 0.95rem;
}
.cost-meter strong { color: var(--ink); }
.cost-meter.over { background: #FBE0E3; color: var(--danger); border-color: #F2B5BC; }

/* Show list (admin dashboard) */
.show-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.show-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 22px;
    text-decoration: none;
    color: var(--ink);
    transition: transform 100ms, box-shadow 120ms;
}
.show-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.show-card .name { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.show-card .meta { color: var(--ink-soft); font-size: 0.95rem; }

/* Submissions list */
.subs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sub-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 100ms;
}
.sub-card:hover { transform: translateY(-2px); }
.sub-card .photo { aspect-ratio: 1.4; background: var(--bg-soft); object-fit: cover; width: 100%; display: block; }
.sub-card .body { padding: 16px 18px; }
.sub-card .first { font-size: 1.4rem; font-weight: 800; }
.sub-card .nick { color: var(--ink-soft); font-size: 0.95rem; }

/* QR area */
.qr-card {
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 22px;
}
.qr-card img { width: min(320px, 80vw); height: auto; border-radius: var(--radius-sm); }
.qr-card .url {
    margin-top: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1rem; color: var(--ink-soft); word-break: break-all;
}

/* QR row — when there are 2 QRs side by side */
.qr-row { display: flex; gap: 18px; flex-wrap: wrap; }
.qr-row .qr-card { flex: 1; min-width: 280px; }

/* Show landing — public */
.landing-hero { text-align: center; padding: 24px 0; }
.landing-hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.landing-hero .topic { font-size: 1.3rem; color: var(--ink-soft); margin-bottom: 18px; }

/* Photo preview tile */
.photo-tile { width: 100%; aspect-ratio: 1.3; object-fit: cover; border-radius: var(--radius-sm); }

/* Inline alert */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 600; }
.alert-info  { background: #E6F4FF; color: #0B5C8A; }
.alert-warn  { background: #FFF1D6; color: #8A5A0B; }
.alert-error { background: #FBE0E3; color: #9A2331; }

/* Utility */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 28px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.tiny { font-size: 0.85rem; }
.mb-0 { margin-bottom: 0; }
.mb-md { margin-bottom: 18px; }
.mb-lg { margin-bottom: 32px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 32px; }
.hidden { display: none !important; }
.spacer { height: 28px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }

/* Tags chips */
.tag-chip {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: var(--bg-soft); color: var(--ink-soft);
    margin: 0 6px 6px 0; font-size: 0.9rem; font-weight: 600;
}

/* Visually freeze a form during submission without disabling its fields
   (disabled fields are stripped from the form data). */
form.is-locked .field,
form.is-locked .file-drop,
form.is-locked .radio-row,
form.is-locked .checkbox-row {
    opacity: 0.55;
    pointer-events: none;
}

/* Indeterminate progress bar — used while server-side generation is running */
.progress-bar {
    width: 100%; height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 30%;
    border-radius: inherit;
}
.progress-bar-fill.indeterminate {
    position: absolute;
    width: 30%;
    animation: indet 1.4s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes indet {
    0%   { left: -30%; }
    100% { left: 100%; }
}

/* iPad / large screens — even bigger UI */
@media (min-width: 768px) {
    html, body { font-size: 21px; }
    .btn { padding: 20px 34px; font-size: 1.2rem; min-height: 64px; }
}
@media (min-width: 1100px) {
    html, body { font-size: 22px; }
}
