:root {
    --bg: #eef4ff;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --line: #cbd5e1;
    --accent: #0369a1;
    --accent-strong: #075985;
    --success-bg: #ecfdf5;
    --success-text: #166534;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(2, 132, 199, 0.14), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 360px);
    gap: 20px;
    align-items: start;
}

.hero__copy,
.status-card,
.panel {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero__copy {
    padding: 32px;
}

.status-card,
.panel {
    padding: 24px;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--accent);
}

h1,
h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.96;
}

h2 {
    font-size: 1.5rem;
}

.lead {
    margin: 18px 0 0;
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--muted);
}

.hero__list {
    margin: 22px 0 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.status-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(203, 213, 225, 0.7);
    font-size: 0.98rem;
}

.status-line:last-of-type {
    margin-bottom: 16px;
}

.workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: #e0f2fe;
    color: var(--accent-strong);
    font-size: 0.86rem;
    font-weight: 700;
}

.field {
    display: block;
    margin-bottom: 16px;
}

.field > span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
}

select {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 16px;
    font-size: 1rem;
    outline: none;
}

select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.24);
}

.file-picker {
    display: grid;
    justify-items: start;
    gap: 12px;
    padding: 18px;
    border: 1px dashed #7dd3fc;
    border-radius: 22px;
    background: linear-gradient(180deg, #f8fdff 0%, #eef8ff 100%);
    cursor: pointer;
    transition: 0.18s ease;
}

.file-picker:hover {
    border-color: #38bdf8;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-1px);
}

.file-picker.is-active {
    border-color: #0284c7;
    box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.24);
    background: linear-gradient(180deg, #ecfeff 0%, #e0f2fe 100%);
}

.file-picker.is-dragover {
    border-color: #0ea5e9;
    background: linear-gradient(180deg, #ecfeff 0%, #dbeafe 100%);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.22);
    transform: translateY(-1px);
}

.file-picker__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-picker__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-width: 220px;
    height: 48px;
    padding: 0 20px;
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    text-align: center;
    line-height: 1;
    font-size: 0.96rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    box-shadow: 0 8px 22px rgba(14, 165, 233, 0.10);
}

.file-picker__hint {
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.95rem;
    max-width: 34ch;
}

.certificate-card,
.file-meta,
.downloads {
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 20px;
    background: #f8fbff;
    padding: 16px;
}

.certificate-card dl {
    margin: 0;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 12px;
    font-size: 0.94rem;
}

.certificate-card dt {
    color: #64748b;
    font-weight: 600;
}

.certificate-card dd {
    margin: 0;
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
}

.placeholder,
.file-meta {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.file-meta {
    display: grid;
    gap: 4px;
}

.file-meta strong {
    color: var(--text);
    font-size: 0.98rem;
}

.file-meta span {
    font-size: 0.92rem;
}

.file-meta.is-empty {
    background: #f8fbff;
}

.file-meta.is-ready {
    border-color: #7dd3fc;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfeff 100%);
}

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

.primary-button,
.secondary-button,
.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: 0.18s ease;
}

.primary-button {
    background: linear-gradient(135deg, #0284c7 0%, #0f766e 100%);
    color: #fff;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.download-link:hover {
    transform: translateY(-1px);
}

.secondary-button {
    width: 100%;
    border-color: #bae6fd;
    background: #f0f9ff;
    color: var(--accent-strong);
}

.primary-button:disabled,
.secondary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 16px;
    border-radius: 18px;
    padding: 14px 16px;
    font-size: 0.96rem;
    line-height: 1.6;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fecaca;
}

.downloads {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.download-link {
    border-color: rgba(148, 163, 184, 0.38);
    background: #fff;
    color: #0f172a;
}

.hidden {
    display: none;
}

code {
    font-family: "Cascadia Mono", "Consolas", monospace;
}

@media (max-width: 900px) {
    .hero,
    .workspace {
        grid-template-columns: 1fr;
    }

    .shell {
        width: min(100% - 20px, 1120px);
        padding-top: 20px;
    }

    .hero__copy,
    .status-card,
    .panel {
        padding: 20px;
    }

    .certificate-card dl {
        grid-template-columns: 1fr;
    }
}
