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

:root {
    --color-bg: #0d0b08;
    --color-surface: #17140f;
    --color-surface-raised: #1e1a13;
    --color-gold: #c9a227;
    --color-gold-light: #e8cf8a;
    --color-text: #f2ead9;
    --color-text-muted: #9c9280;
    --color-border: #3a3226;
    --color-error: #d97757;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--color-bg);
    background-image: radial-gradient(circle at 50% 0%, #1a160f 0%, #0d0b08 60%);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

.wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

.brand {
    text-align: center;
    margin-bottom: 8px;
}

.brand img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 18px;
}

.brand h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: 0.03em;
    margin: 0;
    color: var(--color-gold-light);
}

.brand p.tagline {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin: 8px 0 0;
}

.ornament {
    width: 100%;
    max-width: 220px;
    margin: 28px auto 40px;
    display: block;
    opacity: 0.85;
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 32px;
}

.field-label {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.field-input {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 13px 14px;
    font-size: 1rem;
    font-family: var(--font-body);
}

.field-input:focus {
    outline: none;
    border-color: var(--color-gold);
}

.btn {
    display: inline-block;
    width: 100%;
    background: var(--color-gold);
    color: #17140f;
    border: none;
    padding: 13px 20px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    margin-top: 18px;
    transition: background 0.15s ease;
}

.btn:hover { background: var(--color-gold-light); }
.btn:focus-visible { outline: 2px solid var(--color-gold-light); outline-offset: 2px; }

.btn-secondary {
    background: transparent;
    color: var(--color-gold-light);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover { border-color: var(--color-gold); background: var(--color-surface-raised); }

.captcha-row {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--color-border);
}

.message {
    padding: 14px 16px;
    border-left: 3px solid var(--color-error);
    background: rgba(217, 119, 87, 0.1);
    color: var(--color-text);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.message.locked {
    border-left-color: var(--color-gold);
    background: rgba(201, 162, 39, 0.08);
}

/* Certificate result card */
.cert-card {
    margin-top: 32px;
    border: 1px solid var(--color-gold);
    padding: 2px;
}

.cert-card-inner {
    border: 1px solid var(--color-border);
    padding: 32px;
}

.cert-card-header {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.cert-card-header .status {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-gold-light);
    margin: 0;
}

.status-icon {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 50%;
    font-size: 1rem;
    font-family: var(--font-body);
    vertical-align: middle;
    margin-right: 6px;
}

.status-verified .status-icon {
    background: var(--color-gold);
    color: #17140f;
}

.status-notfound .status-icon {
    background: var(--color-error);
    color: #17140f;
}

.status-notfound {
    color: var(--color-error) !important;
}

.cert-card-header .verified-at {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-top: 6px;
}

.cert-card-notfound {
    border-color: var(--color-error);
}

.notfound-hint {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.92rem;
    margin: 0;
}

.cert-card-header .cert-number {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: 6px;
}

.cert-details {
    display: grid;
    grid-template-columns: 140px 1fr;
    row-gap: 14px;
    column-gap: 16px;
    font-size: 0.98rem;
}

.cert-details dt {
    color: var(--color-text-muted);
    margin: 0;
}

.cert-details dd {
    margin: 0;
    color: var(--color-text);
}

.download-btn {
    margin-top: 28px;
    text-align: center;
}

.download-btn a {
    display: inline-block;
    background: var(--color-gold);
    color: #17140f;
    text-decoration: none;
    padding: 13px 32px;
    font-weight: 600;
    font-size: 0.98rem;
    transition: background 0.15s ease;
}

.download-btn a:hover { background: var(--color-gold-light); }

footer {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-top: 56px;
}

@media (max-width: 480px) {
    .cert-details { grid-template-columns: 1fr; row-gap: 4px; }
    .cert-details dt { margin-top: 10px; }
    .panel { padding: 22px; }
}

/* ---- Admin panel ---- */
.admin-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.admin-topbar h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-gold-light);
    margin: 0;
}

.admin-topbar a { color: var(--color-text-muted); text-decoration: none; font-size: 0.9rem; }
.admin-topbar a:hover { color: var(--color-gold-light); }

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.admin-table th {
    text-align: left;
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
}

table.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
}

table.admin-table a { color: var(--color-gold-light); text-decoration: none; margin-right: 12px; font-size: 0.88rem; }
table.admin-table a:hover { text-decoration: underline; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid .full { grid-column: 1 / -1; }

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-group { margin-bottom: 0; }

.hint { color: var(--color-text-muted); font-size: 0.82rem; margin-top: 6px; }

.add-btn {
    display: inline-block;
    background: var(--color-gold);
    color: #17140f;
    text-decoration: none;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.add-btn:hover { background: var(--color-gold-light); }
