/* ==========================================
   EduSkill.org — Shared Form Styles
   Reusable across: Training, Services, Certifications
   ========================================== */

/* Form Section Wrapper */
.booking-form-section {
    position: relative;
    padding: var(--spacing-xxl) 0;
    background-color: var(--color-deep-blue, #0d1b4a);
    overflow: hidden;
}

/* Background image overlay with low opacity for subtle texture blend */
.booking-form-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../assets/images/meetings-bg.webp');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.45;
    z-index: 1;
    pointer-events: none;
}

.booking-form-section .container {
    position: relative;
    z-index: 2;
}

.booking-form-section .section-header {
    text-align: center;
    margin-bottom: 40px;
}

.booking-form-section .section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.booking-form-section .section-desc {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Split Column Styles for Certifications pages using standard form section background */
.booking-form-section .info-column {
    color: rgba(255, 255, 255, 0.85);
}

.booking-form-section .info-column h2 {
    color: var(--color-white);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.booking-form-section .info-column p {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.booking-form-section .info-column strong {
    color: var(--color-white);
}

/* Form Card */
.booking-form-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    max-width: 580px;
    margin: 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.booking-form-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.25);
}

/* Form Groups */
.booking-form-card .form-group {
    margin-bottom: 16px;
}

.booking-form-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary-blue);
    margin-bottom: 4px;
}

.booking-form-card label .req-star {
    color: #dc3545;
    margin-left: 2px;
}

/* Form Fields */
.booking-form-card .form-field {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid rgba(13, 27, 74, 0.08);
    border-radius: 10px;
    background-color: #f7f9fc;
    color: var(--color-dark-text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    outline: none;
    box-sizing: border-box;
}

.booking-form-card .form-field:focus {
    border-color: var(--color-accent-main);
    background-color: var(--color-white);
    box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.12);
}

/* Clear duplicate padding in split certification container */
.booking-form-section .registration-container {
    padding: 0;
}

.booking-form-card select.form-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231B0B45' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.booking-form-card select.form-field option {
    color: var(--color-dark-text);
    background: var(--color-white);
}

.booking-form-card textarea.form-field {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox Group */
.booking-form-card .form-check-group {
    margin-bottom: var(--spacing-md);
}

.booking-form-card .form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.booking-form-card .form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--color-accent-main);
}

.booking-form-card .check-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.booking-form-card .check-text a {
    color: var(--color-accent-main);
    text-decoration: none;
    font-weight: 500;
}

.booking-form-card .check-text a:hover {
    text-decoration: underline;
}

/* Submit Button */
.booking-form-card .btn-submit {
    display: block;
    width: 100%;
    background: var(--color-deep-blue);
    color: var(--color-white);
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    font-family: 'Poppins', sans-serif;
}

.booking-form-card .btn-submit:hover {
    background: var(--color-professional-purple);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(91, 59, 140, 0.3);
}

.booking-form-card .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Error Message */
.booking-form-card .field-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.booking-form-card .form-group.has-error .form-field {
    border-color: #dc3545;
}

.booking-form-card .form-group.has-error .field-error {
    display: block;
}

/* reCAPTCHA Container */
.booking-form-card .g-recaptcha {
    margin-bottom: var(--spacing-md);
}

/* Loading State */
.booking-form-card .btn-submit.loading {
    pointer-events: none;
}

.booking-form-card .btn-submit.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* Success Modal */
.booking-success-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.booking-success-overlay.show {
    display: flex;
}

.booking-success-box {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.booking-success-box .success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.booking-success-box .success-icon svg {
    width: 32px;
    height: 32px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
}

.booking-success-box h3 {
    font-size: 1.4rem;
    color: var(--color-primary-blue);
    margin-bottom: 8px;
}

.booking-success-box p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Submit Button Disabled State & Privacy Consent */
.btn-submit:disabled,
.btn-submit.btn-disabled,
button[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.6) !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: auto; /* allows click to focus on unchecked checkbox */
}

/* Privacy Consent Checkbox Styles */
.form-privacy-group,
.form-check-group {
    margin: 18px 0;
    text-align: left;
}

.privacy-consent-label,
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.86rem;
    color: inherit;
    cursor: pointer;
    line-height: 1.45;
    margin-bottom: 8px;
}

.privacy-consent-label input[type="checkbox"],
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #0066ff;
    cursor: pointer;
    flex-shrink: 0;
}

.privacy-consent-label a,
.form-check a {
    color: #0066ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Hide form fields upon successful submission */
form.has-submitted > *:not(.form-submission-success-banner) {
    display: none !important;
}
form.has-submitted .form-submission-success-banner {
    display: block !important;
    width: 100%;
    margin: 0 auto;
}

/* Inline Form Submission Success Card */
.form-submission-success-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    margin: 16px 0;
    animation: fadeInScale 0.35s ease;
}

.form-submission-success-banner .success-check-badge {
    width: 48px;
    height: 48px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.form-submission-success-banner h4 {
    color: #065f46;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-submission-success-banner p {
    color: #047857;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

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

.booking-success-box .btn-ok {
    display: inline-block;
    background: #28a745;
    color: #fff;
    border: none;
    padding: 12px 36px;
    border-radius: var(--radius-md, 8px);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Poppins', sans-serif;
}

.booking-success-box .btn-ok:hover {
    background: #218838;
}

/* Error Modal */
.booking-error-box .success-icon {
    background: #dc3545;
}

.booking-error-box .btn-ok {
    background: #dc3545;
}

.booking-error-box .btn-ok:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 991px) {
    .booking-form-section {
        padding: 40px 0;
    }

    .booking-form-card {
        padding: 24px;
        border-radius: 12px;
    }
}

@media (max-width: 576px) {
    .booking-form-section {
        padding: 30px 0;
    }

    .booking-form-section .section-title {
        font-size: 1.6rem;
    }

    .booking-form-card {
        padding: 20px 16px;
        border-radius: 10px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
    
    .booking-form-card .form-field {
        padding: 10px 12px;
    }
}

/* Newsletter Subscription Banner */
.newsletter-banner {
    background-color: #7ccefa;
    padding: 40px 0;
    text-align: center;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.newsletter-banner .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.newsletter-banner h3 {
    color: #1b0b45;
    font-size: 1.95rem;
    font-weight: 700;
    margin-bottom: 16px;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.newsletter-banner h3::before {
    content: '';
    position: absolute;
    bottom: 1.5px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #1b0b45;
    opacity: 0.25;
    border-radius: 1px;
}

.newsletter-banner h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #1b0b45, #5b3b8c);
    border-radius: 2px;
    z-index: 1;
}

.newsletter-banner p {
    color: rgba(27, 11, 69, 0.85);
    font-size: 0.95rem;
    margin-top: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form .form-field {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid transparent;
    border-radius: 30px;
    font-size: 0.9rem;
    outline: none;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.newsletter-form .form-field:focus {
    border-color: #1b0b45;
    box-shadow: 0 4px 15px rgba(27, 11, 69, 0.15);
}

.newsletter-form .btn-subscribe {
    background: #1b0b45;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 10px rgba(27, 11, 69, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.newsletter-form .btn-subscribe:hover {
    background: #2c126d;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(27, 11, 69, 0.3);
}

.newsletter-form .btn-subscribe i {
    font-size: 0.85rem;
}

@media (max-width: 576px) {
    .newsletter-banner {
        padding: 30px 16px;
    }
    
    .newsletter-banner h3 {
        font-size: 1.4rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .newsletter-form .form-field {
        width: 100%;
        text-align: center;
    }
    
    .newsletter-form .btn-subscribe {
        width: 100%;
        justify-content: center;
    }
}
