/* ===========================================
   Intake — refined editorial aesthetic
   Override --accent in config.php to rebrand.
   =========================================== */

:root {
    --bg: #FAF8F4;
    --surface: #FFFFFF;
    --surface-2: #F2EFE8;
    --ink: #1A1D1B;
    --ink-soft: #4A4D4B;
    --muted: #8A8A87;
    --line: #E5E2DC;
    --line-strong: #D5D2CC;
    --accent: #4A6A4A;
    --accent-soft: #E8EFE8;
    --accent-ink: #2D4530;
    --error: #B0413E;
    --error-soft: #F5E5E4;
    --success: #5A7F5A;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 14px;

    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Layout ===== */
.page {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 28px 80px;
}

.page--wide {
    max-width: 1120px;
}

header.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 56px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.wordmark {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 22px;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

.wordmark span {
    color: var(--accent);
}

.head-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.head-meta a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 16px;
    transition: color 0.15s;
}

.head-meta a:hover {
    color: var(--ink);
}

/* ===== Hero / page title ===== */
.hero {
    margin-bottom: 40px;
}

.hero h1 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    color: var(--ink);
}

.hero h1 em {
    font-style: italic;
    color: var(--accent);
}

.hero p {
    font-size: 16px;
    color: var(--ink-soft);
    max-width: 56ch;
    margin: 0;
}

/* ===== Card / panel ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.card + .card {
    margin-top: 20px;
}

/* ===== Form elements ===== */
label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 8px;
}

input[type="password"],
input[type="text"],
input[type="search"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink);
    transition: border-color 0.15s, background 0.15s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

button {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 13px 24px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s, color 0.15s;
}

button:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--ink);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--accent-ink);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
    background: var(--surface-2);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid transparent;
    padding: 6px 10px;
    font-size: 13px;
}

.btn-danger:hover {
    background: var(--error-soft);
}

.btn-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== Alerts ===== */
.alert {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
}

.alert--error {
    background: var(--error-soft);
    border-color: var(--error);
    color: var(--error);
}

.alert--success {
    background: var(--accent-soft);
    border-color: var(--success);
    color: var(--accent-ink);
}

/* ===== Drop zone ===== */
.dropzone {
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 64px 32px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    position: relative;
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 50%;
    color: var(--accent);
}

.dropzone-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 6px;
}

.dropzone-hint {
    font-size: 13px;
    color: var(--muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ===== Upload list (in upload page) ===== */
.upload-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-row {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.upload-row__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.upload-row__size {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.upload-row__status {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.upload-row__status.is-done {
    color: var(--success);
}

.upload-row__status.is-error {
    color: var(--error);
}

.upload-row__progress {
    width: 80px;
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-row__bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.2s;
}

/* ===== Admin: stats ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.stat__label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat__value {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1;
}

/* ===== Admin: toolbar ===== */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar input[type="search"] {
    flex: 1;
    min-width: 200px;
}

/* ===== Admin: file table ===== */
.file-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.file-row {
    display: grid;
    grid-template-columns: 44px 1fr 140px 110px 80px;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    transition: background 0.1s;
}

.file-row:last-child {
    border-bottom: none;
}

.file-row:hover {
    background: var(--surface-2);
}

.file-row__icon {
    width: 36px;
    height: 36px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-row__name {
    min-width: 0;
}

.file-row__name strong {
    display: block;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row__name small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row__time,
.file-row__size {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-soft);
}

.file-row__actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.file-row__actions a,
.file-row__actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.file-row__actions a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.file-row__actions button:hover {
    background: var(--error-soft);
    color: var(--error);
}

/* Empty state */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
}

.empty .empty__title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-style: italic;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

/* ===== Footer ===== */
footer.page-foot {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
    .page {
        padding: 28px 18px 60px;
    }
    .hero h1 {
        font-size: 32px;
    }
    .card {
        padding: 22px;
    }
    .dropzone {
        padding: 48px 20px;
    }
    .file-row {
        grid-template-columns: 36px 1fr 80px;
        gap: 12px;
    }
    .file-row__time,
    .file-row__size {
        display: none;
    }
    header.page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 32px;
    }
}
