:root {
    color-scheme: light;
    --rose: #c93f70;
    --rose-dark: #a92e5a;
    --rose-pale: #fff0f3;
    --rose-soft: #f9dce4;
    --ink: #30242a;
    --muted: #75666d;
    --line: #f0dfe4;
    --paper: #ffffff;
    --page: #fff8f9;
    --danger: #a82b3b;
    --shadow: 0 12px 36px rgb(87 39 58 / 7%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--page);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--page);
    font-size: 16px;
    line-height: 1.55;
}

button,
input {
    font: inherit;
}

a {
    color: var(--rose-dark);
}

.site-header {
    width: 100%;
    padding: max(12px, env(safe-area-inset-top)) clamp(16px, 5vw, 32px) 12px;
}

.brand {
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 15px;
    color: var(--rose);
    background: var(--rose-pale);
    font-size: 20px;
}

.brand-copy {
    display: grid;
    line-height: 1.25;
}

.brand-copy strong {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.brand-copy span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.page-shell {
    width: min(100%, 780px);
    min-height: calc(100vh - 130px);
    margin-inline: auto;
    padding: 12px clamp(16px, 5vw, 32px) 40px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    color: var(--ink);
    line-height: 1.16;
    letter-spacing: -0.035em;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 9vw, 46px);
}

h2 {
    margin-bottom: 7px;
    font-size: clamp(21px, 6vw, 27px);
}

p {
    color: var(--muted);
}

.hero {
    padding: clamp(22px, 7vw, 44px) 2px 24px;
    text-align: center;
}

.hero h1 {
    margin-top: 10px;
    color: var(--rose-dark);
}

.hero-subtitle {
    max-width: 390px;
    margin: 0 auto 7px;
}

.school-note {
    margin-bottom: 0;
    color: var(--rose-dark);
    font-size: 14px;
    font-weight: 700;
}

.eyebrow {
    display: inline-block;
    color: var(--rose-dark);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

.card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.login-card,
.camera-card,
.created-card,
.download-card,
.message-card {
    padding: clamp(20px, 6vw, 30px);
}

.login-card {
    max-width: 520px;
    margin: 0 auto;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 21px;
}

.section-heading p {
    margin-bottom: 0;
    font-size: 14px;
}

.icon-disc {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 16px;
    color: var(--rose);
    background: var(--rose-pale);
    font-size: 23px;
}

.stack-form {
    display: grid;
    gap: 10px;
}

.stack-form label {
    margin-top: 7px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.stack-form input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #d9cbd0;
    border-radius: 13px;
    outline: none;
    color: var(--ink);
    background: #fff;
    font-size: 16px;
}

.stack-form input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgb(201 63 112 / 14%);
}

.email-form {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffafb;
}

.email-form label {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.email-form label span {
    color: var(--muted);
    font-weight: 500;
}

.email-form input {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #d9cbd0;
    border-radius: 12px;
    color: var(--ink);
    background: white;
    font-size: 16px;
}

.email-form input:focus {
    border-color: var(--rose);
    outline: 3px solid rgb(201 63 112 / 14%);
}

.email-privacy-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 15px;
    border: 1px solid transparent;
    border-radius: 13px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
    -webkit-tap-highlight-color: transparent;
}

.button:active {
    transform: scale(0.985);
}

.button:focus-visible,
a:focus-visible {
    outline: 3px solid rgb(201 63 112 / 40%);
    outline-offset: 3px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.button-primary {
    color: #fff;
    background: var(--rose);
}

.button-primary:hover:not(:disabled) {
    background: var(--rose-dark);
}

.button-secondary {
    border-color: #efcdd8;
    color: var(--rose-dark);
    background: #fff8fa;
}

.button-secondary:hover:not(:disabled) {
    background: var(--rose-pale);
}

.button-quiet {
    border-color: var(--line);
    color: var(--ink);
    background: #fff;
}

.button-danger {
    border-color: #f2ccd0;
    color: var(--danger);
    background: #fff7f7;
}

.button-full {
    width: 100%;
}

.button-tall {
    min-height: 58px;
    font-size: 17px;
}

.button-small {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 13px;
}

.alert {
    margin: 0 0 17px;
    padding: 12px 14px;
    border: 1px solid #efc4cc;
    border-radius: 12px;
    color: #8f2438;
    background: #fff4f5;
    font-size: 14px;
}

.success-message {
    margin: -8px 0 18px;
    padding: 12px 14px;
    border: 1px solid #cbe6d3;
    border-radius: 12px;
    color: #226b3a;
    background: #f2fbf4;
    font-size: 14px;
}

.helper-text,
.camera-hint,
.download-help,
.privacy-note {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.55;
}

.admin-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 25px;
}

.admin-topline h1 {
    margin: 5px 0 6px;
    font-size: clamp(30px, 8vw, 40px);
}

.admin-topline p {
    max-width: 380px;
    margin-bottom: 0;
    font-size: 14px;
}

.admin-topline form {
    flex: 0 0 auto;
}

.camera-card {
    margin-bottom: 34px;
}

.camera-stage {
    margin-top: 18px;
}

.camera-stage video,
.camera-stage img {
    display: block;
    width: 100%;
    max-height: 65svh;
    border-radius: 16px;
    background: #261a20;
    object-fit: contain;
}

.camera-stage video {
    aspect-ratio: 3 / 4;
    cursor: pointer;
    object-fit: cover;
}

.camera-stage img {
    margin-inline: auto;
}

.camera-message {
    min-height: 24px;
    margin: 13px 0;
    font-size: 14px;
    text-align: center;
}

.camera-message.is-error {
    color: var(--danger);
    font-weight: 650;
}

.camera-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.camera-close {
    width: 100%;
    margin-top: 10px;
}

.history-section {
    min-width: 0;
}

.history-heading {
    justify-content: space-between;
    margin-bottom: 16px;
}

.history-heading h2 {
    margin: 5px 0 0;
}

.count-pill {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 100px;
    color: var(--rose-dark);
    background: var(--rose-pale);
    font-size: 13px;
    vertical-align: 3px;
}

.photo-list {
    display: grid;
    gap: 12px;
}

.photo-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 13px;
}

.photo-thumb {
    display: block;
    width: 88px;
    height: 96px;
    border-radius: 12px;
    background: var(--rose-pale);
    object-fit: cover;
}

.photo-info {
    min-width: 0;
}

.photo-info > strong,
.photo-info > span {
    display: block;
}

.photo-info > strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.photo-info > span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.photo-actions form {
    margin: 0;
}

.empty-state {
    display: grid;
    min-height: 160px;
    align-content: center;
    justify-items: center;
    padding: 24px;
    text-align: center;
}

.empty-state p {
    margin: 7px 0 2px;
    color: var(--ink);
    font-weight: 700;
}

.empty-state > span:last-child {
    color: var(--muted);
    font-size: 13px;
}

.empty-heart {
    color: var(--rose);
    font-size: 30px;
}

.created-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.created-card > div {
    width: 100%;
}

.created-photo {
    display: block;
    width: min(100%, 420px);
    max-height: 50svh;
    border: 1px solid var(--line);
    border-radius: 15px;
    object-fit: contain;
}

.created-card p {
    margin-bottom: 0;
}

.qr-large {
    display: block;
    width: min(100%, 310px);
    height: auto;
    aspect-ratio: 1;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    image-rendering: pixelated;
}

.text-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
}

.download-card {
    max-width: 620px;
    margin: 22px auto 0;
    text-align: center;
}

.download-card h1 {
    margin-top: 7px;
    font-size: clamp(32px, 9vw, 44px);
}

.access-intro {
    margin: 18px 0 14px;
    color: var(--ink);
    font-weight: 650;
}

.download-access-form {
    text-align: left;
}

.download-image-wrap {
    display: grid;
    min-height: 200px;
    max-height: 62svh;
    place-items: center;
    margin: 22px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fffafb;
}

.download-photo {
    display: block;
    width: 100%;
    max-height: 62svh;
    object-fit: contain;
}

.download-help {
    margin-top: 15px;
    text-align: left;
}

.privacy-note {
    margin-top: 12px;
    color: var(--rose-dark);
    font-weight: 650;
}

.message-card {
    max-width: 560px;
    margin: clamp(24px, 10vh, 90px) auto;
}

.message-card h1 {
    margin-top: 8px;
    font-size: clamp(29px, 8vw, 38px);
}

.site-footer {
    padding: 17px 16px max(22px, env(safe-area-inset-bottom));
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

[hidden] {
    display: none !important;
}

@media (max-width: 360px) {
    .admin-topline {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-topline form,
    .admin-topline .button {
        width: 100%;
    }

    .photo-card {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
    }

    .photo-thumb {
        width: 68px;
        height: 78px;
    }

    .photo-actions .button {
        padding-inline: 9px;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .page-shell {
        min-height: auto;
    }

    .camera-stage video {
        width: auto;
        max-width: 100%;
        max-height: 52svh;
        aspect-ratio: 16 / 9;
        margin-inline: auto;
    }

    .download-image-wrap,
    .download-photo {
        max-height: 48svh;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
