/* SuspAct, Direction B "Clean Studio". See STYLE.md. */

:root {
    --yellow: #F0BF12;
    --yellow-hover: #E4AA1B;
    --yellow-tint: #FDF3C6;
    --yellow-tint-text: #6B5200;
    --ink: #1D1D1B;
    --paper: #FAFAF7;
    --white: #FFFFFF;
    --text-muted: #5D5D57;
    --text-subtle: #6A6A63;
    --line: #E6E5DD;
    --border-strong: #CFCFC6;
    --error: #B42318; /* not in STYLE.md: needed for form errors */

    --radius-panel: 28px;
    --radius-card: 20px;
    --radius-button: 12px;
    --radius-nav: 10px;
    --gutter: 64px;
}

@media (max-width: 800px) {
    :root { --gutter: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }

/* Components that set display (flex, grid) would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--ink); text-underline-offset: 3px; }

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: 1312px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Header and footer */

.admin-bar { background: var(--ink); color: var(--paper); padding: 10px 0; }

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 24px;
    font-size: 14px;
    font-weight: 500;
}

.admin-nav a { color: var(--paper); text-decoration: none; }
.admin-nav a:hover { text-decoration: underline; }
.admin-nav a:focus-visible { outline-color: var(--paper); }

.admin-label {
    background: var(--yellow);
    color: var(--ink);
    border-radius: 6px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-header { padding: 24px 0; }

.site-header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.brand svg { width: 44px; height: 44px; flex: none; }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    font-size: 15px;
    font-weight: 500;
}

.site-nav a,
.site-nav button.nav-link { color: var(--ink); text-decoration: none; }

.site-nav a:hover,
.site-nav button.nav-link:hover { text-decoration: underline; }

.nav-label {
    color: var(--text-subtle);
    font-size: 13px;
    font-weight: 500;
}

.nav-action {
    background: var(--ink);
    color: var(--paper) !important;
    border-radius: var(--radius-nav);
    padding: 11px 20px;
    text-decoration: none;
}

.nav-action:hover { text-decoration: none !important; background: #000; }

button.nav-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

form.inline { display: inline; margin: 0; }

.site-footer {
    margin-top: auto;
    padding: 40px 0;
    border-top: 1px solid var(--line);
    color: var(--text-subtle);
    font-size: 14px;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

.site-footer .brand { font-size: 16px; color: var(--ink); }
.site-footer .brand svg { width: 32px; height: 32px; }

/* Content */

main.container { padding-top: 72px; padding-bottom: 96px; }

h1, h2, h3 { margin: 0; color: var(--ink); }

h1 {
    font-size: 36px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.015em;
}

h1.display {
    font-size: clamp(44px, 7vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.035em;
    max-width: 14ch;
}

p { margin: 0 0 16px; }

.lead {
    font-size: 20px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 38rem;
    margin-top: 24px;
}

.muted { color: var(--text-muted); }

.page-head { margin-bottom: 40px; }
.page-head .lead { font-size: 18px; margin-top: 16px; }

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
}

/* Buttons */

.button,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 16px 28px;
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    background: var(--yellow);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
button[type="submit"]:hover { background: var(--yellow-hover); }

.button-secondary {
    background: var(--white);
    border-color: var(--border-strong);
}

.button-secondary:hover { background: var(--paper); }

/* Badge and accent rule */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--yellow-tint);
    color: var(--yellow-tint-text);
    font-size: 14px;
    font-weight: 500;
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yellow);
}

.accent-rule {
    display: block;
    width: 40px;
    height: 4px;
    margin-bottom: 16px;
    background: var(--yellow);
}

/* Cards and forms */

.card {
    max-width: 32rem;
    padding: 40px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
}

@media (max-width: 800px) {
    .card { padding: 24px; }
}

.stack { display: grid; gap: 24px; }

label {
    display: grid;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-button);
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}

input[aria-invalid="true"] { border-color: var(--error); }

.field-error {
    color: var(--error);
    font-size: 14px;
    font-weight: 500;
}

.form-links { margin: 32px 0 0; color: var(--text-muted); font-size: 15px; }

/* Flash messages */

.flash {
    margin-bottom: 24px;
    padding: 14px 18px;
    border-radius: var(--radius-button);
    background: var(--yellow-tint);
    color: var(--yellow-tint-text);
    font-weight: 500;
}

.flash-error {
    background: var(--white);
    border: 1px solid var(--error);
    color: var(--error);
}

/* License page */

.eyebrow {
    margin: 0 0 8px;
    color: var(--text-subtle);
    font-size: 14px;
    font-weight: 500;
}

h3 {
    margin: 24px 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 24px;
    align-items: start;
}

.license-grid .card { max-width: none; }

.license-type {
    margin: 0;
    font-size: 36px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.license-validity { margin: 12px 0 0; color: var(--text-muted); }
.license-validity.is-expired { color: var(--error); font-weight: 500; }

.request-pending .badge { margin-bottom: 16px; }

.details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 24px;
    margin: 16px 0 0;
}

.details dt { color: var(--text-subtle); font-size: 15px; }
.details dd { margin: 0; }

code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.95em;
}

.section { margin-top: 72px; }
.section > h2 + p { margin-top: 8px; }
.section form { margin: 0; }
.section-note { margin-top: 40px; }

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 24px;
    margin-top: 24px;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
}

.option-card h3 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }
.option-price { margin: 4px 0 24px; color: var(--text-muted); }

button.button-secondary { background: var(--white); border-color: var(--border-strong); }
button.button-secondary:hover { background: var(--paper); }

.table {
    width: 100%;
    margin-top: 24px;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.table th,
.table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.table th { color: var(--text-subtle); font-size: 14px; font-weight: 500; }
.table tbody tr:last-child td { border-bottom: 0; }

.table .nowrap { white-space: nowrap; }

.status { font-size: 14px; font-weight: 500; }
.status-approved { color: var(--ink); }
.status-rejected { color: var(--error); }
.status-pending { color: var(--yellow-tint-text); }

@media (max-width: 800px) {
    .table th, .table td { padding: 12px 8px; }
}

/* Admin: bike files */

.page-head-split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tile {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
}

/* Same 4:3 shape as the stored images (see bike_images in config/settings.php). */
.tile-image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.tile-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tile-image img[hidden] { display: none; }

.tile-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-subtle);
    font-size: 14px;
}

.tile-placeholder[hidden] { display: none; }

.tile-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 20px 24px 24px;
}

.tile-name {
    font-size: 18px;
    overflow-wrap: anywhere;
}

.tile-meta { margin: 0; color: var(--text-muted); font-size: 14px; }

.tile-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
}

.button-small {
    min-height: 36px;
    padding: 6px 16px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-nav);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.button-small:hover { background: var(--paper); }

.button-danger-text { color: var(--error); }

button.button-danger { background: var(--error); color: var(--white); }
button.button-danger:hover { background: #912018; }

.empty-state { max-width: none; }
.empty-state p { margin: 8px 0 0; }

/* Dialogs */

.dialog {
    width: min(100% - 32px, 36rem);
    max-height: calc(100% - 32px);
    padding: 0;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(29, 29, 27, 0.16);
}

.dialog-narrow { width: min(100% - 32px, 28rem); }

.dialog::backdrop { background: rgba(29, 29, 27, 0.45); }

.dialog-form {
    display: grid;
    gap: 20px;
    padding: 32px;
}

.dialog-form h2 { overflow-wrap: anywhere; }
.dialog-form p { margin: 0; }

.dialog-image {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
    align-items: start;
}

.dialog-image .tile-image {
    border: 1px solid var(--line);
    border-radius: var(--radius-button);
    overflow: hidden;
}

@media (max-width: 520px) {
    .dialog-form { padding: 24px; }
    .dialog-image { grid-template-columns: 1fr; }
}

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 4px;
}

.dialog-warning { color: var(--error); font-weight: 500; }

.dialog .flash { margin: 0; }

.hint {
    color: var(--text-subtle);
    font-size: 14px;
    font-weight: 400;
}

.hint:empty { display: none; }

input[type="file"] {
    width: 100%;
    padding: 8px;
    background: var(--paper);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-button);
    font: inherit;
    font-size: 15px;
    font-weight: 400;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-nav);
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: progress; }

/* Bike catalog */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.search { width: min(100%, 20rem); }

.catalog-section + .catalog-section { margin-top: 72px; }
.catalog-section > h2 { margin-bottom: 8px; }
.catalog-section .tile-grid { margin-top: 24px; }
.section-intro { margin: 0; }
.search-empty { margin-top: 24px; }

.tile h3.tile-name { margin: 0; font-size: 18px; letter-spacing: -0.015em; }

a.button-small {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

button.button-small[type="submit"] {
    min-height: 36px;
    padding: 6px 16px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-nav);
    font-size: 15px;
    font-weight: 500;
}

button.button-small[type="submit"]:hover { background: var(--paper); }

/* Request status label on top of the tile image. */
.tile-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--white);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(29, 29, 27, 0.2);
}

.tile-status-pending { background: var(--yellow-tint); color: var(--yellow-tint-text); }
.tile-status-rejected { background: var(--white); color: var(--error); }

.pay-note {
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-left: 4px solid var(--yellow);
    border-radius: var(--radius-button);
}

/* Admin: users */

.user-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.user-row { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px 24px; }
.user-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.user-name { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.user-email { margin: 0; color: var(--text-muted); overflow-wrap: anywhere; }
.user-license { margin: 4px 0 0; font-size: 14px; color: var(--text-muted); }
.user-license.is-expired { color: var(--error); }
.user-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.user-controls form { display: flex; gap: 8px; align-items: center; margin: 0; }
.user-controls select { font: inherit; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--white); }
.user-history { margin-top: 16px; }
.user-history summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.user-history .table { margin-top: 12px; }

/* Language flags */

.locale-switch { display: inline-flex; align-items: center; gap: 8px; }
.locale-switch a { display: inline-flex; line-height: 0; border-radius: 3px; opacity: 0.55; outline-offset: 3px; }
.locale-switch a:hover, .locale-switch a.is-current { opacity: 1; }
.locale-switch svg { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(29, 29, 27, 0.18); }
.locale-switch a.is-current svg { box-shadow: 0 0 0 1px rgba(29, 29, 27, 0.18), 0 0 0 3px var(--yellow); }
