.afp-a4 {
    max-width: 820px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    padding: 50px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111827;
    position: relative;
}

/* Header */
.afp-a4-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 3px double #2563eb;
    margin-bottom: 26px;
}

.afp-logo {
    max-height: 80px;
    margin-bottom: 10px;
}

.afp-a4-header h1 {
    margin: 0;
    font-size: 26px;
    color: #1e3a8a;
    letter-spacing: .5px;
}

.afp-motto {
    margin: 6px 0 14px;
    font-style: italic;
    color: #6b7280;
    font-size: 14px;
}

.afp-a4-header h2 {
    margin: 16px 0 4px;
    font-size: 18px;
    color: #111827;
}

.afp-desc {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Progress bar */
.afp-progress-wrap {
    margin-bottom: 24px;
}

.afp-progress-bar {
    background: #e5e7eb;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.afp-progress-fill {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    height: 100%;
    transition: width .3s ease;
}

.afp-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.afp-step-label {
    font-weight: 600;
    color: #2563eb;
}

/* Fields */
.afp-step {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 22px;
}

.afp-field {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.afp-field.afp-half {
    width: calc(50% - 11px);
}

.afp-field.afp-field-textarea,
.afp-field.afp-field-file {
    width: 100%;
}

.afp-field label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #374151;
}

.afp-star {
    color: #dc2626;
}

.afp-field input[type="text"],
.afp-field input[type="email"],
.afp-field input[type="tel"],
.afp-field input[type="number"],
.afp-field input[type="date"],
.afp-field select,
.afp-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    background: #fff;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.afp-field input:focus,
.afp-field select:focus,
.afp-field textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.afp-field input.afp-invalid,
.afp-field select.afp-invalid,
.afp-field textarea.afp-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}

.afp-field-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.afp-field-error.is-visible {
    display: block;
}

.afp-help {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.afp-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 14px;
    font-weight: 500;
}

.afp-section-title {
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 12px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #dbeafe;
}

/* File upload zone */
.afp-file-zone {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: #f9fafb;
}

.afp-file-zone:hover,
.afp-file-zone.afp-drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}

.afp-file-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.afp-file-hint {
    font-size: 14px;
    color: #6b7280;
    pointer-events: none;
}

.afp-file-hint small {
    font-size: 12px;
    color: #9ca3af;
}

.afp-file-preview {
    margin-top: 12px;
    pointer-events: none;
}

.afp-file-preview img {
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.afp-file-preview .afp-file-name {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
}

/* Payment box */
.afp-payment-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin: 26px 0 18px;
}

.afp-fee-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
}

.afp-fee-row strong {
    color: #2563eb;
    font-size: 20px;
}

.afp-fee-note {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.afp-free-box {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.afp-free-box .afp-fee-note {
    color: #065f46;
}

/* Nav buttons */
.afp-nav-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.afp-nav-prev,
.afp-nav-next {
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
}

.afp-nav-prev:hover,
.afp-nav-next:hover {
    background: #f9fafb;
}

.afp-nav-next {
    margin-left: auto;
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.afp-nav-next:hover {
    background: #1d4ed8;
}

.afp-submit {
    flex: 1;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .2s;
}

.afp-submit:hover {
    background: #1d4ed8;
}

.afp-submit:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.afp-save-resume {
    margin-top: 16px;
    text-align: center;
}

.afp-save-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 6px;
}

.afp-save-btn:hover {
    color: #2563eb;
}

/* Notices */
.afp-notice {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.afp-notice-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.afp-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Save-resume modal */
.afp-save-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.afp-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.afp-modal-content h3 {
    margin-top: 0;
}

.afp-modal-content p {
    color: #6b7280;
    font-size: 14px;
}

.afp-modal-content input[type="email"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    margin: 12px 0;
    box-sizing: border-box;
}

.afp-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.afp-modal-cancel,
.afp-modal-send {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.afp-modal-cancel {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.afp-modal-send {
    background: #2563eb;
    border: none;
    color: #fff;
}

.afp-modal-send:hover {
    background: #1d4ed8;
}

/* Responsive */
@media (max-width: 700px) {
    .afp-a4 {
        padding: 30px 22px;
        margin: 16px;
    }

    .afp-field.afp-half {
        width: 100%;
    }

    .afp-nav-bar {
        flex-wrap: wrap;
    }

    .afp-nav-next,
    .afp-submit {
        width: 100%;
    }

    .afp-nav-next {
        margin-left: 0;
    }
}

/* Mobile-first refinements */
@media (max-width: 700px) {
    .afp-a4 {
        padding: 24px 16px !important;
        margin: 8px !important;
        border-radius: 10px;
        box-shadow: 0 2px 12px rgba(0,0,0,.06);
    }
    .afp-a4-header h1 { font-size: 20px; }
    .afp-a4-header h2 { font-size: 16px; }
    .afp-logo { max-height: 50px; }
    .afp-field.afp-half { width: 100% !important; }
    .afp-field input,
    .afp-field select,
    .afp-field textarea {
        font-size: 16px !important; /* prevents iOS zoom-on-focus */
        padding: 12px 14px;
    }
    .afp-nav-bar { flex-direction: column-reverse; gap: 8px; }
    .afp-nav-prev, .afp-nav-next, .afp-submit { width: 100%; }
    .afp-payment-box { padding: 14px 16px; margin: 20px 0 14px; }
    .afp-progress-labels { font-size: 12px; }
    .afp-step { gap: 14px; }
}