@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Playfair+Display:wght@500;600&display=swap');

:root {
    --bg: #15191a;
    --card: #202526;
    --border: #363d3e;
    --text: #e8e9e8;
    --muted: #7d8789;
    --gold: #dca95d;
    --gold-soft: #e4b466;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 25%, rgba(255,255,255,.025), transparent 30%),
        var(--bg);
    color: var(--text);
    font-family: "DM Mono", monospace;
}

a { color: inherit; text-decoration: none; }

.page {
    width: min(100% - 48px, 840px);
    margin: 0 auto;
    padding: 65px 0 30px;
}

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

.brand {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .25em;
}

.tagline,
.quote-meta,
.author,
.saved-count,
.section-heading,
.number,
.row-author,
footer {
    font-size: 9px;
    letter-spacing: .24em;
    text-transform: uppercase;
}

.tagline { color: #788183; }

.quote-card,
.admin-card {
    background: rgba(32, 37, 38, .94);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 50px rgba(0,0,0,.16);
}

.quote-card {
    min-height: 388px;
    padding: 46px 45px 43px;
    display: flex;
    flex-direction: column;
}

.quote-meta {
    display: flex;
    justify-content: space-between;
    color: #7c8586;
    margin-bottom: 28px;
}

.quote-meta span:last-child { color: var(--gold); }

blockquote {
    position: relative;
    margin: 0;
    max-width: 710px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(31px, 4vw, 43px);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.025em;
}

.opening {
    color: var(--gold);
    margin-right: 2px;
}

.author {
    color: #879092;
    margin-top: 26px;
}

.card-footer {
    margin-top: auto;
    padding-top: 23px;
    border-top: 1px solid #343a3b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.next-button,
.secondary-button {
    border: 0;
    border-radius: 5px;
    padding: 13px 21px;
    background: var(--gold-soft);
    color: #1a1b1b;
    font-family: "DM Mono", monospace;
    font-size: 11px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.next-button:hover,
.secondary-button:hover {
    background: #edbc70;
    transform: translateY(-1px);
}

.next-button span { margin-left: 8px; }

.saved-count { color: #5f696b; }

.saved { margin-top: 55px; }

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #647072;
}

.section-heading .line {
    flex: 1;
    height: 1px;
    background: #343a3b;
}

.quote-list { margin-top: 14px; }

.quote-row {
    display: grid;
    grid-template-columns: 38px 1fr 70px;
    align-items: center;
    min-height: 43px;
    border-bottom: 1px solid #2d3334;
    gap: 10px;
    transition: background .15s ease;
}

.quote-row:hover { background: rgba(255,255,255,.025); }

.number { color: var(--gold); font-size: 8px; }
.row-text {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #d8dbdb;
    line-height: 1.5;
}
.row-author {
    color: #606b6d;
    font-size: 7px;
    text-align: right;
}

.empty {
    padding: 28px 0;
    color: #657072;
    font-size: 11px;
}

footer {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #526062;
    margin-top: 67px;
}

.footer-line {
    width: 25px;
    height: 1px;
    background: #4c5657;
}

footer a {
    margin-left: auto;
    color: #6e797b;
}

.flash {
    margin: -30px 0 30px;
    padding: 12px 15px;
    border: 1px solid rgba(220,169,93,.3);
    background: rgba(220,169,93,.07);
    color: #dcb474;
    font-size: 11px;
    border-radius: 6px;
}

.admin-card {
    padding: 42px;
}

.admin-card .section-heading {
    margin-bottom: 32px;
}

form { display: grid; gap: 10px; }

label {
    color: #8a9495;
    font-size: 9px;
    letter-spacing: .18em;
    text-transform: uppercase;
    margin-top: 12px;
}

textarea,
input {
    width: 100%;
    border: 1px solid #394142;
    border-radius: 7px;
    outline: none;
    background: #181c1d;
    color: #e6e8e7;
    font: 13px/1.6 "DM Mono", monospace;
    padding: 14px 15px;
}

textarea {
    min-height: 180px;
    resize: vertical;
}

textarea:focus,
input:focus {
    border-color: #b98b4c;
    box-shadow: 0 0 0 2px rgba(220,169,93,.07);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.secondary-button {
    background: #303738;
    color: #b8bebe;
}

.errors {
    border: 1px solid rgba(200,80,80,.35);
    background: rgba(200,80,80,.08);
    color: #e6a1a1;
    padding: 13px 15px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 12px;
}

@media (max-width: 650px) {
    .page {
        width: min(100% - 28px, 840px);
        padding-top: 30px;
    }

    .topbar { margin-bottom: 35px; }

    .quote-card { padding: 30px 25px; min-height: 420px; }
    .admin-card { padding: 27px 23px; }

    blockquote { font-size: 30px; }

    .quote-row {
        grid-template-columns: 30px 1fr;
        padding: 9px 0;
    }

    .row-author { display: none; }

    .card-footer {
        align-items: flex-end;
        gap: 14px;
    }

    .saved-count { text-align: right; }
}
