:root {
    --ink: #10263e;
    --ink-soft: #4f6175;
    --canvas: #eef3f6;
    --card: rgba(255, 255, 255, 0.92);
    --line: rgba(16, 38, 62, 0.12);
    --accent: #0b6e4f;
    --accent-soft: #d9efe7;
    --error: #8f1d2c;
    --error-soft: #f8d7dc;
    --shadow: 0 18px 50px rgba(16, 38, 62, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(11, 110, 79, 0.12), transparent 30%),
        linear-gradient(135deg, #f9fcff 0%, #eef3f6 60%, #dde7ed 100%);
    min-height: 100vh;
}

.page-shell {
    width: min(1200px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

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

.site-header h1,
.viewer-header h2,
.auth-card h2,
.intro-card h2 {
    margin: 0;
    font-weight: 700;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.auth-card,
.intro-card {
    width: min(580px, 100%);
    padding: 28px;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.document-card,
.viewer-card,
.signer-card {
    padding: 24px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.95fr);
    gap: 20px;
    align-items: start;
}

.viewer-header,
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stack-form {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

label {
    font-weight: 600;
}

input,
button {
    font: inherit;
}

input[type="email"],
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(16, 38, 62, 0.18);
    background: rgba(255, 255, 255, 0.95);
}

button,
.button-link,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
}

button,
.button-link {
    border: none;
    background: var(--accent);
    color: white;
}

.ghost-button,
.secondary-link {
    background: transparent;
    color: var(--ink);
    border: 1px solid rgba(16, 38, 62, 0.18);
}

.secondary-link {
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
}

.user-pill,
.status {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(16, 38, 62, 0.06);
}

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

.message {
    padding: 14px 16px;
    border-radius: 16px;
}

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

.message.info {
    background: #e5efff;
    color: #15458a;
}

.pdf-frame {
    width: 100%;
    min-height: 860px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

.signature-pad {
    width: 100%;
    max-width: 100%;
    border: 1px dashed rgba(16, 38, 62, 0.25);
    border-radius: 20px;
    background: white;
    touch-action: none;
}

.signature-actions,
.checkbox-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.support-copy {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

@media (max-width: 980px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .pdf-frame {
        min-height: 640px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100vw - 20px, 100%);
        padding-top: 20px;
    }

    .site-header,
    .viewer-header,
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card,
    .intro-card,
    .document-card,
    .viewer-card,
    .signer-card {
        padding: 20px;
    }
}
