:root {
    --navy-900: #0B1D33;
    --navy-800: #122B4A;
    --navy-700: #1A3A5C;
    --gold: #C8973E;
    --gold-light: #E8B84D;
    --green: #2D8F5E;
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-100: #F0F2F5;
    --gray-200: #E2E5EA;
    --gray-600: #6B7280;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-800);
    line-height: 1.7;
    background: var(--gray-50);
}

/* ===== NAVBAR ===== */
nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
}
.nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.shield-icon {
    width: 36px;
    height: 36px;
    background: var(--navy-900);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 20px;
    font-weight: 800;
}
.nav-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy-900);
}
.nav-logo-text span { color: var(--gold); }
.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
    align-items: center;
}
.nav-links a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--navy-900); }

/* ===== LEGAL PAGE HEADER ===== */
.legal-header {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
    padding: 48px 0;
    text-align: center;
}
.legal-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}
.legal-header p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
}

/* ===== LEGAL CONTENT ===== */
.legal-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.legal-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 48px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.legal-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy-900);
    margin: 36px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
}
.legal-card h2:first-child {
    margin-top: 0;
}
.legal-card p {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.8;
}
.legal-card ul, .legal-card ol {
    margin: 12px 0 20px 24px;
    font-size: 0.95rem;
}
.legal-card li {
    margin-bottom: 8px;
    line-height: 1.7;
}
.legal-card strong {
    color: var(--gray-900);
}

/* ===== FORM FIELDS IN LEGAL DOCS ===== */
.field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}
.field-group.single {
    grid-template-columns: 1fr;
}
.field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.field input, .field textarea, .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}
.field textarea {
    resize: vertical;
    min-height: 60px;
}
.field input.error, .field textarea.error, .field select.error {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.field-error-msg {
    font-size: 0.8rem;
    color: #EF4444;
    margin-top: 4px;
    display: none;
}
.field-error-msg.visible {
    display: block;
}

/* ===== CHECKBOXES ===== */
.checkbox-group {
    margin: 16px 0;
}
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    cursor: pointer;
}
.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--navy-900);
    cursor: pointer;
}

/* ===== SIGNATURE BLOCK ===== */
.signature-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--navy-900);
}
.signature-block {
    margin-bottom: 40px;
}
.signature-block h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-900);
    margin-bottom: 20px;
}
.sig-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 20px;
}
.sig-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

/* ===== E-SIGNATURE (Type-to-Sign) ===== */
.esign-container {
    margin: 16px 0;
}
.esign-box {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 24px;
    background: var(--white);
}
.esign-input-wrapper {
    position: relative;
    margin-bottom: 12px;
}
.esign-type-input {
    width: 100%;
    padding: 20px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy-900);
    background: #FAFBFC;
    text-align: center;
    transition: border-color 0.2s;
}
.esign-type-input::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--gray-600);
}
.esign-type-input:focus {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}
.esign-preview {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid var(--navy-900);
    margin: 16px 0 8px;
    padding-bottom: 4px;
}
.esign-preview-text {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1;
}
.esign-preview-placeholder {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-style: italic;
}
.esign-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 12px;
    gap: 16px;
}
.esign-legal {
    font-size: 0.8rem;
    color: var(--gray-600);
    max-width: 500px;
    line-height: 1.5;
}
.esign-clear {
    background: none;
    border: 1px solid var(--gray-200);
    padding: 6px 16px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: border-color 0.2s;
    white-space: nowrap;
}
.esign-clear:hover {
    border-color: var(--gray-800);
    color: var(--gray-800);
}
.esign-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--gray-800);
}
.esign-consent-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--navy-900);
    cursor: pointer;
}

/* ===== SUBMIT / ACTION BUTTONS ===== */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.btn-submit {
    background: var(--gold);
    color: var(--white);
    border: none;
    padding: 14px 36px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.2s;
}
.btn-submit:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}
.btn-submit:disabled {
    background: var(--gray-200);
    color: var(--gray-600);
    cursor: not-allowed;
    transform: none;
}
.btn-secondary {
    background: var(--white);
    color: var(--navy-900);
    border: 2px solid var(--navy-900);
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.btn-secondary:hover {
    background: var(--gray-50);
}

/* ===== SUCCESS MESSAGE ===== */
.form-success {
    display: none;
    text-align: center;
    padding: 60px 40px;
}
.form-success.visible {
    display: block;
}
.form-success .success-icon {
    width: 72px;
    height: 72px;
    background: #D1FAE5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}
.form-success h2 {
    border: none;
    margin: 0 0 12px;
    padding: 0;
}
.form-success p {
    color: var(--gray-600);
}

/* ===== TIMESTAMP DISPLAY ===== */
.esign-timestamp {
    font-size: 0.8rem;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
}

/* ===== MANDATORY REPORTING NOTICE ===== */
.notice-box {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-left: 4px solid #F59E0B;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 20px 0;
}
.notice-box.critical {
    background: #FEE2E2;
    border-color: #EF4444;
    border-left-color: #EF4444;
}
.notice-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.notice-box p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ===== PRINT BUTTON ===== */
.print-bar {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 24px 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.btn-print {
    background: var(--navy-900);
    color: var(--white);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.btn-print:hover {
    background: var(--navy-700);
}

/* ===== FOOTER ===== */
footer {
    background: var(--navy-900);
    color: rgba(255,255,255,0.7);
    padding: 30px 0;
    text-align: center;
    font-size: 0.85rem;
}

/* ===== EFFECTIVE DATE ===== */
.effective-date {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 32px;
    font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .legal-card { padding: 28px 20px; }
    .field-group { grid-template-columns: 1fr; }
    .sig-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .legal-header h1 { font-size: 1.5rem; }
}

/* ===== PRINT STYLES ===== */
@media print {
    nav, footer, .print-bar { display: none !important; }
    body { background: white; font-size: 11pt; }
    .legal-header {
        background: none !important;
        padding: 24px 0;
        border-bottom: 3px solid #0B1D33;
    }
    .legal-header h1 { color: #0B1D33 !important; font-size: 18pt; }
    .legal-header p { color: #6B7280 !important; }
    .legal-container { padding: 20px 0; }
    .legal-card {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .legal-card h2 {
        font-size: 13pt;
        page-break-after: avoid;
    }
    .signature-section { page-break-inside: avoid; }
    .notice-box {
        border: 2px solid #000 !important;
        background: #f5f5f5 !important;
    }
    .field { border-bottom: 1px solid #000; }
    .checkbox-item .box { border: 1px solid #000; }
    a { color: inherit; text-decoration: none; }
}
