/* Shared Modal Styles */

.fn2-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 1rem;
}

.fn2-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fn2-modal {
    background: var(--bg-card, rgba(22, 22, 24, 0.98));
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.fn2-modal-overlay.active .fn2-modal {
    transform: scale(1);
}

.fn2-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.fn2-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
    margin: 0;
}

.fn2-modal-close {
    background: none;
    border: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.fn2-modal-close:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.05);
}

.fn2-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

.fn2-modal-footer {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

/* Form styles within modal */
.fn2-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .fn2-modal .form-row {
        grid-template-columns: 1fr;
    }
}

.fn2-modal .form-group {
    margin-bottom: 1rem;
}

.fn2-modal .form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fn2-modal .form-group label .field-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.fn2-modal .form-group label .optional {
    font-weight: 400;
    color: var(--text-muted, rgba(255, 255, 255, 0.3));
    text-transform: none;
    letter-spacing: normal;
}

.fn2-modal .form-group input,
.fn2-modal .form-group textarea,
.fn2-modal .form-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 6px;
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.fn2-modal .form-group input::placeholder,
.fn2-modal .form-group textarea::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.3));
}

.fn2-modal .form-group input:focus,
.fn2-modal .form-group textarea:focus,
.fn2-modal .form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.fn2-modal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Form footer with intro text and button */
.fn2-modal .form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.fn2-modal .form-footer .fn2-modal-intro {
    margin: 0;
    flex: 1;
}

.fn2-modal .form-footer .fn2-modal-btn-primary {
    width: auto;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .fn2-modal .form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .fn2-modal .form-footer .fn2-modal-intro {
        text-align: center;
        order: 2;
        margin-top: 0.75rem;
    }
    
    .fn2-modal .form-footer .fn2-modal-btn-primary {
        width: 100%;
        order: 1;
    }
}

/* Modal intro text */
.fn2-modal-intro {
    font-size: 0.75rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

/* Primary button in modal - outline style matching checkout */
.fn2-modal-btn-primary {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.12));
    border-radius: 6px;
    color: var(--text-primary, #fff);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.fn2-modal-btn-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.fn2-modal-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fn2-modal-btn-primary .spinner {
    width: 18px;
    height: 18px;
    animation: fn2-modal-spin 1s linear infinite;
}

@keyframes fn2-modal-spin {
    to { transform: rotate(360deg); }
}

/* Success state */
.fn2-modal-success {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.fn2-modal-success svg {
    width: 40px;
    height: 40px;
    color: rgba(34, 197, 94, 0.8);
    margin-bottom: 1.25rem;
}

.fn2-modal-success h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
    margin: 0 0 0.4rem 0;
}

.fn2-modal-success p {
    font-size: 0.85rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    margin: 0;
}

/* Captcha container in modal */
.fn2-modal .captcha-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    min-height: 78px;
}

/* Error message */
.fn2-modal-error {
    font-size: 0.8rem;
    color: rgba(248, 113, 113, 0.9);
    text-align: center;
    margin: 0 0 0.5rem 0;
    min-height: 1.2em;
}

/* Intro section styling */
.fn2-modal-intro-section {
    margin-bottom: 1rem;
}

.fn2-modal-intro-section .fn2-modal-intro {
    margin: 0;
    text-align: center;
}

