/* ============================================
   CTA MODAL — Đặt lịch tư vấn với Đỗ Văn Hưng
   File: CTA/cta-modal.css
   ============================================ */

/* === MODAL OVERLAY === */
.cta-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* === MODAL CONTAINER === */
.cta-modal {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 480px;
    width: 100%;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.cta-modal-overlay.active .cta-modal {
    transform: scale(1) translateY(0);
}

/* Top accent line */
.cta-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, #a78bfa, transparent);
    border-radius: 0 0 2px 2px;
}

/* === CLOSE BUTTON === */
.cta-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
}

.cta-modal-close:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    color: #f43f5e;
}

/* === MODAL HEADER === */
.cta-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.cta-modal-header .modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 16px;
}

.cta-modal-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 6px;
}

.cta-modal-header p {
    font-size: 14px;
    color: #64748b;
}

/* === FORM === */
.cta-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cta-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cta-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

.cta-form-group label .required {
    color: #f43f5e;
    margin-left: 2px;
}

.cta-form-group input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #f1f5f9;
    transition: all 0.25s ease;
    outline: none;
}

.cta-form-group input::placeholder {
    color: #475569;
}

.cta-form-group input:focus {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cta-form-group input.error {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(244, 63, 94, 0.06);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.cta-form-group .error-msg {
    font-size: 12px;
    color: #f43f5e;
    display: none;
}

.cta-form-group input.error + .error-msg {
    display: block;
}

/* === SUBMIT BUTTON === */
.cta-submit-btn {
    margin-top: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cta-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.4);
}

.cta-submit-btn:active {
    transform: translateY(0);
}

.cta-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.cta-submit-btn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.cta-submit-btn.loading .spinner {
    display: block;
}

.cta-submit-btn.loading .btn-text {
    display: none;
}

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

/* === SUCCESS STATE === */
.cta-success {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.cta-success.show {
    display: block;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.cta-success .success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    animation: pulse-success 1.5s ease-in-out infinite;
}

@keyframes pulse-success {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

.cta-success h3 {
    font-size: 20px;
    font-weight: 800;
    color: #34d399;
    margin-bottom: 8px;
}

.cta-success p {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
}

.cta-success .zalo-redirect {
    margin-top: 16px;
    font-size: 13px;
    color: #64748b;
}

.cta-success .zalo-redirect .countdown {
    color: #60a5fa;
    font-weight: 700;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .cta-modal {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .cta-modal-header h2 {
        font-size: 19px;
    }

    .cta-form-group input {
        padding: 11px 14px;
    }
}
