/* ── MELO AI — design tokens ───────────────────────────────────────
   Subject: a Filipino-run content studio's private toolshed — the
   feel of unlocking gear, not a generic SaaS login. Palette leans
   warm/tropical (mango, guava) against a deep ink background, like a
   dashboard lit up at night in a small studio. Display face is a
   rounded-geometric slab for stamped, "access badge" energy; body is
   a plain grotesk for legibility on a phone screen. */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --ink: #14121A;
    --ink-raised: #1D1A25;
    --ink-line: #2C2836;
    --mango: #FFB238;
    --guava: #FF6B5B;
    --mint: #3FD6A6;
    --paper: #F4F0E8;
    --paper-dim: #B8B2C4;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .stamp {
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

a { color: inherit; }

/* Layout shell */
.shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 24px 20px 40px;
}

.shell.wide { max-width: 720px; }
.shell.grid-wide { max-width: 960px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.brand {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand .dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--mango);
    box-shadow: 0 0 12px var(--mango);
}

.pill {
    font-size: 12px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--ink-line);
    color: var(--paper-dim);
    text-decoration: none;
}
.pill:hover { border-color: var(--mango); color: var(--mango); }

/* Auth cards */
.auth-card {
    background: var(--ink-raised);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-top: 12px;
}

.auth-card h1 {
    font-size: 24px;
    margin: 0 0 4px;
}
.auth-card p.sub {
    color: var(--paper-dim);
    font-size: 14px;
    margin: 0 0 22px;
}

label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--paper-dim);
    margin: 16px 0 6px;
}
label:first-of-type { margin-top: 0; }

input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    background: var(--ink);
    border: 1px solid var(--ink-line);
    color: var(--paper);
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}
input:focus, textarea:focus {
    border-color: var(--mango);
    box-shadow: 0 0 0 3px rgba(255,178,56,0.15);
}

textarea { resize: vertical; min-height: 160px; line-height: 1.5; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 22px;
}
.btn-primary { background: var(--mango); color: #201607; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--ink-line); color: var(--paper); margin-top: 10px; }
.btn-ghost:hover { border-color: var(--paper-dim); }
.btn-mint { background: var(--mint); color: #05231a; }
.btn-outline-mint { background: transparent; border: 1px solid var(--mint); color: var(--mint); margin-top: 10px; }

.foot-link {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--paper-dim);
}
.foot-link a { color: var(--mango); font-weight: 600; text-decoration: none; }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 16px;
}
.alert-error { background: rgba(255,107,91,0.12); border: 1px solid rgba(255,107,91,0.4); color: #FFB3A8; }
.alert-ok { background: rgba(63,214,166,0.12); border: 1px solid rgba(63,214,166,0.4); color: #A6F0DA; }

/* Dashboard greeting */
.greeting { margin-bottom: 22px; }
.greeting .eyebrow { color: var(--mango); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.greeting h1 { font-size: 26px; margin: 4px 0 0; }

/* Product cards */
.product-list { display: flex; flex-direction: column; gap: 12px; }

.product-card {
    background: var(--ink-raised);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius);
    padding: 18px 18px;
    position: relative;
    overflow: hidden;
}
.product-card.unlocked { border-color: rgba(255,178,56,0.35); }
.product-card.unlocked::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--mango);
}

.product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-name { font-weight: 600; font-size: 16.5px; }
.status-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 4px 9px;
    border-radius: 999px;
    text-transform: uppercase;
}
.status-tag.active { background: rgba(255,178,56,0.15); color: var(--mango); }
.status-tag.locked { background: rgba(184,178,196,0.12); color: var(--paper-dim); }

.product-card a.btn { margin-top: 14px; }

/* Product / prompt view page */
.stamp {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--mango);
    border: 1px solid rgba(255,178,56,0.35);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.prompt-box {
    background: var(--ink);
    border: 1px solid var(--ink-line);
    border-radius: 12px;
    padding: 16px;
    max-height: 340px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--paper-dim);
    margin: 14px 0 6px;
}

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

.toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--mint);
    color: #05231a;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Admin */
.admin-nav { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-nav a {
    font-size: 13px; font-weight: 600;
    padding: 8px 13px; border-radius: 999px;
    border: 1px solid var(--ink-line); text-decoration: none; color: var(--paper-dim);
}
.admin-nav a.active, .admin-nav a:hover { border-color: var(--mango); color: var(--mango); }

.stat-row { display: flex; gap: 12px; margin-bottom: 22px; }
.stat {
    flex: 1;
    background: var(--ink-raised);
    border: 1px solid var(--ink-line);
    border-radius: 12px;
    padding: 14px 16px;
}
.stat .num { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; color: var(--mango); }
.stat .lbl { font-size: 12px; color: var(--paper-dim); margin-top: 2px; }

.user-row {
    background: var(--ink-raised);
    border: 1px solid var(--ink-line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.user-row .who { font-weight: 600; }
.user-row .email { font-size: 13px; color: var(--paper-dim); margin-bottom: 12px; }
.checkbox-line {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--ink-line);
    font-size: 14px;
}
.checkbox-line:first-of-type { border-top: none; }
.checkbox-line input { width: 18px; height: 18px; accent-color: var(--mango); }

table.simple { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.simple th, table.simple td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--ink-line); }
table.simple th { color: var(--paper-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--paper-dim);
    font-size: 14px;
}

@media (max-width: 420px) {
    .action-row { flex-direction: column; }
}

/* Sample videos page — card grid, each with a 9:16 vertical frame
   for the video itself (only the video is 9:16, not the page). */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 4px;
}

.sample-card {
    background: var(--ink-raised);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.sample-card.unlocked { border-color: rgba(255,178,56,0.35); }

.sample-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.sample-card h2 { font-size: 16.5px; margin: 0; }
.sample-card .note { color: var(--paper-dim); font-size: 12.5px; margin: 0 0 12px; }

/* the 9:16 frame — this is the ONLY thing locked to that ratio */
.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--ink-line);
    margin-bottom: 14px;
}
.video-frame video,
.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}
.video-frame .frame-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: var(--paper-dim);
    font-size: 12.5px;
    line-height: 1.5;
}
.video-frame .frame-empty code {
    display: inline-block;
    margin-top: 6px;
    color: var(--paper);
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 11.5px;
}

.sample-card .btn { margin-top: auto; }

/* Admin upload form (admin/samples.php) */
.upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.upload-row input[type="file"] {
    flex: 1;
    font-size: 12.5px;
    color: var(--paper-dim);
}
.or-divider {
    text-align: center;
    color: var(--paper-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 10px 0;
}
.current-video {
    font-size: 12px;
    color: var(--mint);
    margin-top: 8px;
    word-break: break-all;
}
