:root {
    --base-font-size: 15px;
    --accent: #09a2e9;
    --accent-dark: #097db4;
    --accent-soft: #eaf6fd;
    --accent-border: #bfe6f9;
    --highlight: #09a2e9;
    --bg: #f5f7fb;
    --text: #1f2937;
    --muted: #5b6472;
    --card-border: #dbe3ef;
}

* { box-sizing: border-box; }
body { font-family: Arial, sans-serif; margin: 0; font-size: var(--base-font-size); background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h2, h3 { margin-top: 0.4em; }

.wrap { max-width: 960px; margin: 0 auto; padding: 16px 16px 64px; }
.wrap-wide { max-width: 1100px; }
.wrap-narrow { max-width: 900px; }

.topbar { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--accent); margin-bottom: 16px; }
.clock { font-weight: 600; font-variant-numeric: tabular-nums; }
.lang a { color: var(--accent); text-decoration: none; margin-left: 12px; }
.font-size { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 1em; }

.card { background: #ffffff; border: 1px solid var(--card-border); border-radius: 12px; padding: 20px; box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08); }
.card + .card { margin-top: 16px; }
.card-lg { border-radius: 16px; padding: 28px; }

.logo { display: block; width: auto; height: auto; max-width: 100%; object-fit: contain; }
.logo-lg { max-height: 180px; max-width: min(100%, 320px); }
.logo-md { max-height: 150px; max-width: min(100%, 280px); margin-bottom: 12px; }
.logo-sm { max-height: 96px; max-width: 200px; }

.btn, button { display: inline-block; padding: 10px 14px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; font-weight: 600; font-size: 1em; font-family: inherit; text-decoration: none; cursor: pointer; }
.btn-lg { padding: 12px 18px; border-radius: 10px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

input, textarea { padding: 10px; background: #eef2f7; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; font-size: 1em; max-width: 100%; }
textarea { width: 100%; min-height: 140px; resize: vertical; }
label { display: block; margin-top: 12px; font-weight: 600; }
.wide-input { width: 100%; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.msg { margin-top: 8px; }
.msg-error { color: #dc2626; }
.msg-ok { color: #16a34a; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.muted { color: var(--muted); line-height: 1.6; }
.break { overflow-wrap: anywhere; }

/* landing */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.title { font-size: 2.125em; margin: 12px 0; }
.subtitle { color: var(--muted); font-size: 1.125em; }
.cta { margin-top: 18px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.grid .card + .card, .hero .card + .card { margin-top: 0; }
.details { margin-top: 24px; color: #475569; line-height: 1.6; }
.details-tight { margin-top: 16px; }

/* login */
.login-card { max-width: 420px; margin: 24px auto; }
.login-card button { margin-top: 16px; }
.login-card input { margin-top: 8px; }

/* admin */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.tab-btn { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent-border); padding: 8px 12px; border-radius: 999px; }
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { border-bottom: 1px solid #e2e8f0; padding: 8px; text-align: left; overflow-wrap: anywhere; }
.qr { max-width: 260px; width: 100%; border: 1px solid #e2e8f0; padding: 8px; background: #fff; }

/* public document */
.scan-title { margin-bottom: 8px; }
.doc-id { font-size: 1.375em; font-weight: 600; margin-bottom: 12px; color: var(--highlight); overflow-wrap: anywhere; }
.signed-box { margin-top: 16px; padding: 12px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; }
.signed-label { font-size: 0.75em; text-transform: uppercase; letter-spacing: 1px; color: #64748b; }
.signed-name { margin-top: 6px; font-weight: 600; color: var(--text); }
.meta { margin-top: 20px; color: #475569; line-height: 1.6; }
.proof-stack { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.proof-stack a { display: block; }
.proof { display: block; width: 100%; height: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; image-orientation: from-image; transition: box-shadow 0.15s; }
.proof-stack a:hover .proof { box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15); }

@media (max-width: 900px) {
    .hero, .grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .card-lg { padding: 20px; }
    .top { flex-wrap: wrap; }
}
