/**
 * Faraid PDF Modal Styles
 * Scoped under #faraid-pdf-modal to avoid conflicting with existing plugin CSS.
 */

/* ============================================================
   Overlay
   ============================================================ */
#faraid-pdf-modal.faraid-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.62);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* ============================================================
   Modal Box
   ============================================================ */
#faraid-pdf-modal .faraid-modal-box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 30px 24px;
    position: relative;
    box-sizing: border-box;
    animation: faraidModalIn 0.22s ease-out;
}

@keyframes faraidModalIn {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Close button
   ============================================================ */
#faraid-pdf-modal .faraid-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 4px 6px;
    transition: color 0.2s;
}

#faraid-pdf-modal .faraid-modal-close:hover {
    color: #333;
}

/* ============================================================
   Header
   ============================================================ */
#faraid-pdf-modal .faraid-modal-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #007527;
}

#faraid-pdf-modal .faraid-modal-header h3 {
    color: #007527;
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

#faraid-pdf-modal .faraid-modal-header h3 small {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #555;
    margin-top: 3px;
}

#faraid-pdf-modal .faraid-modal-header p {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

#faraid-pdf-modal .faraid-modal-header p small {
    display: block;
    color: #888;
    margin-top: 3px;
    font-size: 15px;
}

/* ============================================================
   Form Groups  (inherit base .faraid-form-group but override for modal)
   ============================================================ */
#faraid-pdf-form .faraid-form-group {
    margin-bottom: 14px;
}

#faraid-pdf-form .faraid-form-group label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px;
    color: #333;
}

#faraid-pdf-form .faraid-required {
    color: #e53e3e;
    margin-left: 2px;
}

#faraid-pdf-form .faraid-form-group input[type="text"],
#faraid-pdf-form .faraid-form-group input[type="tel"],
#faraid-pdf-form .faraid-form-group input[type="email"],
#faraid-pdf-form .faraid-form-group select {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

#faraid-pdf-form .faraid-form-group input:focus,
#faraid-pdf-form .faraid-form-group select:focus {
    outline: none;
    border-color: #007527;
    box-shadow: 0 0 0 3px rgba(0, 117, 39, 0.14);
}

/* Error state */
#faraid-pdf-form .faraid-form-group.error input,
#faraid-pdf-form .faraid-form-group.error select {
    border-color: #e53e3e;
}

#faraid-pdf-form .faraid-form-group .error-message {
    display: block;
    color: #e53e3e;
    font-size: 11.5px;
    margin-top: 4px;
}

/* ============================================================
/* Privacy note */
#faraid-pdf-modal .faraid-modal-privacy {
    margin: 10px 0 0;
    color: #888;
    font-size: 15px;
    line-height: 1.5;
}

/* ============================================================
   Action buttons
   ============================================================ */
#faraid-pdf-modal .faraid-pdf-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Outline variant (Cancel button) */
#faraid-pdf-modal .faraid-btn-outline-green {
    background: transparent !important;
    border: 2px solid #007527 !important;
    color: #007527 !important;
}

#faraid-pdf-modal .faraid-btn-outline-green:hover {
    background: #f0f9f2 !important;
}

/* Red variant (Cancel button - stacked text, matches Reset button design) */
#faraid-pdf-modal .faraid-btn-outline-red {
    background: #dc3545 !important;
    border: none !important;
    color: white !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 24px !important;
}

#faraid-pdf-modal .faraid-btn-outline-red span {
    display: block;
    font-weight: 600;
}

#faraid-pdf-modal .faraid-btn-outline-red small {
    display: block;
    font-size: 11px;
    font-weight: 400;
}

#faraid-pdf-modal .faraid-btn-outline-red:hover {
    background: #c82333 !important;
}

/* Submit button - stacked text */
#faraid-pdf-submit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

#faraid-pdf-submit .faraid-btn-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

#faraid-pdf-submit .faraid-btn-text span {
    display: block;
    font-weight: 600;
}

#faraid-pdf-submit .faraid-btn-text small {
    display: block;
    font-size: 11px;
    font-weight: 400;
}

/* Loading state — spinner text */
#faraid-pdf-submit .faraid-btn-loading {
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* ============================================================
   Success / Error states
   ============================================================ */
#faraid-pdf-modal .faraid-modal-state {
    text-align: center;
    padding: 16px 0 8px;
}

#faraid-pdf-modal .faraid-modal-state-icon {
    font-size: 60px;
    line-height: 1;
    margin-bottom: 10px;
}

#faraid-pdf-modal .faraid-modal-success .faraid-modal-state-icon { color: #007527; }
#faraid-pdf-modal .faraid-modal-error   .faraid-modal-state-icon { color: #e53e3e; }

#faraid-pdf-modal .faraid-modal-state h4 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
}

#faraid-pdf-modal .faraid-modal-success h4 { color: #007527; }
#faraid-pdf-modal .faraid-modal-error   h4 { color: #e53e3e; }

#faraid-pdf-modal .faraid-modal-state p {
    color: #555;
    font-size: 16px;
    line-height: 1.55;
    margin: 0 0 18px;
}

#faraid-pdf-modal .faraid-modal-state p small {
    display: block;
    color: #888;
    font-size: 13px;
    margin-top: 4px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    #faraid-pdf-modal .faraid-modal-box {
        padding: 22px 16px 18px;
        border-radius: 8px;
    }

    #faraid-pdf-modal .faraid-pdf-form-actions {
        flex-direction: column;
    }

    #faraid-pdf-modal .faraid-pdf-form-actions .faraid-btn {
        width: 100%;
        justify-content: center;
    }
}
