/**
 * Axis Mental Health - Welcome & Booking Section Styles
 * (Welcome Box + Appointment Form)
 *
 * Enqueued in bricks-child/functions.php
 * Refactored to use standardized utilities from styles.css
 * 
 * ============================================================================
 * USES STANDARDIZED CLASSES:
 * - .axis-grid-2 for two-column layout
 * - Design tokens for spacing, colors, typography
 * ============================================================================
 */

/* ==========================================================================
   Welcome & Booking Section Layout - Special negative margin overlap
   ========================================================================== */

.welcome-booking-section {
    margin-top: -110px;
    position: relative;
    z-index: 10;
    padding-bottom: var(--axis-space-10);
}

/* Smooth gradient fade at bottom of section */
.welcome-booking-section::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    height: 80px;
    /* background: linear-gradient(to bottom, transparent 0%, var(--axis-white) 100%); */
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 480px) {
    .welcome-booking-section {
        margin-top: -48px;
    }
}

.welcome-booking-content {
    /* Use standard .axis-grid-2, but override column widths for this layout */
    gap: var(--axis-space-8);
}

@media (min-width: 769px) and (max-width: 991px) {
    .welcome-booking-content {
        gap: var(--axis-space-10);
    }
}

/* Desktop: Fixed-width sidebar + flexible form */
@media (min-width: 992px) {
    .welcome-booking-content {
        grid-template-columns: 440px 1fr;
    }
}

/* ==========================================================================
   Welcome/Intake Box
   ========================================================================== */

/* Status Badge - Prominent availability indicator */
.welcome-status-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--axis-accent) 0%, #f59e0b 100%);
    color: var(--axis-white);
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: var(--axis-font-extrabold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-align: center;
    box-shadow: 0 4px 16px rgba(251, 166, 61, 0.2);
    margin-bottom: var(--axis-space-4);
    position: relative;
    z-index: 2;
    line-height: 1.2;
}

/* Subtle pulse animation - limited runs for professionalism */
@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(251, 166, 61, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(251, 166, 61, 0.6);
    }
}

/* Animate only 3 times, then stop (disabled to reduce motion) */
/* .welcome-status-badge {
    animation: badge-pulse 2s ease-in-out 3;
} */

/* Mobile: Full width badge for better visibility */
@media (max-width: 768px) {
    .welcome-status-badge {
        /* width: 100%; */
        /* display: block; */
        /* padding: 10px 16px; */
        /* font-size: 12px; */
        display: none;
    }
}

.welcome-box {
    background: var(--axis-dark-overlay);
    color: var(--axis-white);
    /* Fluid padding: 24px (mobile) to 40px 36px (desktop) */
    padding: clamp(var(--axis-space-6), 5vw, var(--axis-space-10)) clamp(var(--axis-space-6), 4vw, var(--axis-space-9));
    display: flex;
    flex-direction: column;
    gap: var(--axis-space-5);
    /* Enhanced shadows for depth (from visual-polish) */
    box-shadow:
        0 8px 24px rgba(30, 42, 56, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: var(--axis-radius-lg);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    /* Clip pseudo-element to rounded corners */
    /* Mobile: Center text for better readability */
    text-align: center;
}

/* Desktop: Left-align text */
@media (min-width: 769px) {
    .welcome-box {
        text-align: left;
    }
}

/* Removed ::before overlay - causes visual artifacts with border-left */

/* Add gradient accent bar on top (from visual-polish) */
.welcome-box::after {
    content: '';
    position: absolute;
    top: -1px;
    /* Bleed outside slightly to prevent anti-aliasing gaps */
    left: -1px;
    right: -1px;
    height: 8px;
    /* 7px visible + 1px bleed */
    background: linear-gradient(90deg, var(--axis-primary) 0%, var(--axis-accent) 100%);
    z-index: 1;
}

.welcome-box>* {
    position: relative;
    z-index: 1;
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: var(--axis-space-5);
    justify-content: center;
    align-self: anchor-center;
}

/* Desktop: Left-align header */
@media (min-width: 769px) {
    .welcome-header {
        justify-content: flex-start;
    }
}

.welcome-heading-group {
    flex: 1;
}

.welcome-icon {
    /* flex-shrink: 1; */
    /* font-size: 64px; */
    color: var(--axis-primary);
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
}

.welcome-heading-group h3 {
    font-size: var(--axis-text-xl);
    font-weight: var(--axis-font-bold);
    margin: 0 0 var(--axis-space-3) 0;
    color: var(--axis-white);
    letter-spacing: 0.5px;
}

.welcome-phone {
    font-family: "Rajdhani", sans-serif;
    font-size: clamp(22px, 4vw, 26px);
    font-weight: var(--axis-font-extrabold);
    color: var(--axis-accent);
    margin: 0;
    line-height: var(--axis-line-height-tight);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(251, 166, 61, 0.3);
}

.welcome-phone .phone-link {
    color: var(--axis-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.welcome-phone .phone-link:hover {
    color: var(--axis-white);
}

.welcome-info h3 {
    font-size: var(--axis-text-lg);
    font-weight: var(--axis-font-semibold);
    margin-bottom: var(--axis-space-2);
    color: var(--axis-white);
}

.welcome-text {
    font-size: var(--axis-text-base);
    line-height: var(--axis-line-height-relaxed);
    color: var(--axis-text-light-strong);
    /* text-align: left; */
}

.welcome-list {
    padding: 0;
    color: var(--axis-text-light-strong);
    font-size: var(--axis-text-sm);
    text-align: left;
    list-style: none;
}

.welcome-list li {
    margin-bottom: var(--axis-space-1-5);
    line-height: var(--axis-line-height-relaxed);
}

/* Hide Bricks-generated separator lines in list items */
.welcome-list li .separator,
.welcome-list .separator {
    display: none !important;
}

/* Mobile Modal Button - Show only on mobile, trigger consultation popup */
.welcome-modal-btn {
    display: none;
    /* Hidden by default (desktop) */
}

@media (max-width: 768px) {
    .welcome-modal-btn {
        display: block;
        width: 100%;
        padding: var(--axis-space-4) var(--axis-space-6);
        background: var(--axis-primary);
        color: var(--axis-white);
        font-size: var(--axis-text-lg);
        font-weight: var(--axis-font-bold);
        border: none;
        border-radius: var(--axis-radius-md);
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-top: var(--axis-space-2);
    }

    .welcome-modal-btn:hover,
    .welcome-modal-btn:focus {
        background: var(--axis-primary-dark);
        box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
        transform: translateY(-2px);
    }

    .welcome-modal-btn:active {
        transform: translateY(0);
    }

    /* Hide the appointment form card on mobile */
    .appointment-form-box {
        display: none;
    }
}

.welcome-list li .content {
    display: block !important;
    justify-content: flex-start !important;
}

.btn-contact {
    background: transparent;
    color: var(--axis-primary);
    border: 2px solid var(--axis-primary);
    padding: var(--axis-space-3) var(--axis-space-10);
    font-size: var(--axis-text-sm);
    font-weight: var(--axis-font-semibold);
    cursor: pointer;
    transition: var(--axis-transition-base);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    text-align: center;
}

.btn-contact:hover {
    background: var(--axis-primary);
    color: var(--axis-white);
    /* Reduce motion: avoid lift; keep shadow */
    transform: none;
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.25);
}

.btn-contact:active {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2);
}

.btn-contact:focus {
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.1);
}

/* Form button with enhanced presence (from visual-polish) */
.appointment-form-box .btn-primary,
.appointment-form-box .bricks-button {
    /* box-shadow:
        0 4px 12px rgba(251, 166, 61, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.15); */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.appointment-form-box .btn-primary:hover,
.appointment-form-box .bricks-button:hover {
    /* box-shadow:
        0 6px 20px rgba(251, 166, 61, 0.45),
        0 3px 10px rgba(0, 0, 0, 0.2); */
    /* Reduce motion: avoid lift/scale */
    transform: none !important;
}

/* ==========================================================================
   Appointment Form Box
   ========================================================================== */

.appointment-form-box {
    background: var(--axis-white);
    /* Fluid padding: 24px (mobile) to 40px (desktop) */
    padding: clamp(var(--axis-space-6), 5vw, var(--axis-space-10));
    /* Simplified shadow: clean depth without excessive complexity */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border-radius: var(--axis-radius-lg);
    border: 1px solid var(--axis-primary);
}

/* Moved to consultation-form.css */

/* Form description text (appears above toggle button) */
.appointment-form-box .axis-card__heading+p,
.appointment-form-box .axis-card__heading+.brxe-text-basic,
.appointment-form-box h2+p,
.form-description {
    font-size: var(--axis-text-base);
    line-height: var(--axis-line-height-relaxed);
    color: var(--axis-text-muted);
    margin-bottom: var(--axis-space-6);
}

/* Mobile: Adjust spacing */
@media (max-width: 768px) {
    .form-description {
        font-size: var(--axis-text-sm);
        margin-bottom: var(--axis-space-4);
    }
}

.form-description strong {
    color: var(--axis-text-primary);
    font-weight: var(--axis-font-semibold);
}

/* Progressive Form Pattern - SAME behavior on ALL screen sizes */
/* Start with name + phone visible, email + message hidden until button click */
.progressive-form .form-group.expanded-field {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* When form expanded, show email + message fields */
.progressive-form.form-expanded .form-group.expanded-field {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
    margin: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* Desktop: Name and Phone side-by-side using CSS Grid */
@media (min-width: 768px) {

    /* Use CSS Grid for 2-column layout when not expanded - ultra specific selector */
    .appointment-form-box .brxe-form.appointment-form.progressive-form:not(.form-expanded),
    .brxe-form.appointment-form.progressive-form:not(.form-expanded),
    form.progressive-form:not(.form-expanded) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        column-gap: 16px !important;
        row-gap: 12px !important;
    }

    /* Initial fields occupy one column each */
    .progressive-form:not(.form-expanded) .form-group.initial-field {
        width: auto !important;
        grid-column: span 1 !important;
    }

    /* Button spans both columns */
    .progressive-form:not(.form-expanded) .submit-button-wrapper {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }
}

/* Mobile: All fields stacked full width */
@media (max-width: 767px) {
    .progressive-form .form-group {
        width: 100%;
    }
}

/* Teaser fields container (shows before form expansion) */
.teaser-fields {
    display: flex;
    flex-direction: column;
    gap: var(--axis-space-3);
    margin-bottom: var(--axis-space-5);
    transition: opacity var(--axis-transition-base), max-height var(--axis-transition-base);
}

.appointment-form-box.form-expanded .teaser-fields {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

/* Teaser input fields (name and phone) */
.teaser-name-input,
.teaser-phone-input {
    border-radius: var(--axis-radius-sm);
    font-family: inherit;
}

/* Focus styles removed - handled globally in styles.css line 569 */

.teaser-name-input::placeholder,
.teaser-phone-input::placeholder {
    color: var(--axis-gray-400);
}

/* Error state for teaser inputs */
.teaser-name-input.error,
.teaser-phone-input.error {
    border-color: #dc3232;
    background-color: #fff8f8;
}

/* Form toggle button (show form) */
.form-toggle-btn {
    width: 100%;
    background: var(--axis-primary);
    color: var(--axis-white) !important;
    padding: var(--axis-space-4) var(--axis-space-10);
    border: none;
    border-radius: var(--axis-radius-md);
    font-size: var(--axis-text-base);
    font-weight: var(--axis-font-semibold);
    cursor: pointer;
    transition: var(--axis-transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--axis-space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
}

/* Hide toggle button when form is expanded */
.appointment-form-box.form-expanded .form-toggle-btn {
    display: none;
}

.form-toggle-btn:hover {
    background: var(--axis-primary) !important;
    /* Reduce motion */
    transform: none;
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.3);
}

.form-toggle-btn:active {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.25);
}

.form-toggle-btn:focus {
    outline: 3px solid var(--axis-primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.2);
}

/* Cancel button (shows when form is expanded) */
.form-cancel-btn {
    width: 100%;
    background: transparent;
    color: var(--axis-gray-600);
    padding: var(--axis-space-3);
    border: 2px solid var(--axis-border);
    border-radius: var(--axis-radius-md);
    font-size: var(--axis-text-sm);
    font-weight: var(--axis-font-semibold);
    cursor: pointer;
    transition: var(--axis-transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--axis-space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--axis-space-6);
}

.form-cancel-btn:hover {
    background: var(--axis-gray-100);
    border-color: var(--axis-gray-400);
    color: var(--axis-gray-700);
}

.form-cancel-btn:focus {
    outline: 2px solid var(--axis-primary);
    outline-offset: var(--axis-space-1);
}

.form-cancel-btn i {
    font-size: var(--axis-text-base);
}

/* Form wrapper - collapsible container */
.form-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease;
}

.form-wrapper.expanded {
    max-height: 1000px;
    opacity: 1;
}

/* Scroll lock when form is expanded */
body.form-modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0);
}

/* Overlay effect when form is expanded (optional) */
.appointment-form-box::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--axis-transition-base);
}

.appointment-form-box.form-expanded::before {
    opacity: 1;
    pointer-events: auto;
    z-index: 998;
}

/* Bring form box above overlay */
.appointment-form-box.form-expanded {
    position: relative;
    z-index: 999;
    box-shadow: var(--axis-shadow-xl);
}

/* Hide Bricks default form success message */
.brxe-form .message.success {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    border-radius: 8px !important;
    padding: var(--axis-space-5) !important;
    margin-top: var(--axis-space-4) !important;
    color: #155724 !important;
}

/* Hide form fields when success message is present (Bricks-First approach) */
.brxe-form:has(.message.success) .form-group,
.brxe-form:has(.message.success) .submit-button-wrapper {
    display: none !important;
}

/* Success message styling */
.form-success-message {
    background: #d4edda;
    /* Light green background */
    border: 2px solid #28a745;
    /* Green border */
    border-radius: 8px;
    padding: var(--axis-space-5);
    margin-top: var(--axis-space-4);
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.form-success-message.visible {
    display: block;
    opacity: 1;
}

.form-success-message h4 {
    color: #155724;
    /* Dark green */
    font-size: var(--axis-text-lg);
    font-weight: var(--axis-font-bold);
    margin: 0 0 var(--axis-space-2) 0;
}

.form-success-message p {
    color: #155724;
    /* Dark green */
    font-size: var(--axis-text-base);
    line-height: var(--axis-line-height-relaxed);
    margin: 0;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Appointment form layout ------------------------------------------------ */
/* TEASER FORM: All fields stacked in single column */


/* All form groups full width stacked */
.appointment-form .form-group,
.appointment-form-box .brxe-form .form-group,
.axis-appointment-form .form-group {
    position: relative;
    padding-bottom: 0 !important;
    width: 100%;
}

/* Submit button spans full width */
.appointment-form .submit-button-wrapper,
.appointment-form-box .brxe-form .submit-button-wrapper,
.axis-appointment-form .submit-button-wrapper {
    width: 100%;
}

/* Input / select / textarea styling */


/* Textarea needs separate height handling */
.form-group textarea,
.appointment-form-box .brxe-form textarea,
.axis-appointment-form textarea {
    min-height: var(--axis-space-12);
    line-height: normal;
    resize: vertical;
}

/* Focus styles removed - handled globally in styles.css line 569 */

/* Custom select arrow (will apply when using <select>) */
.form-group select,
.appointment-form-box .brxe-form select,
.axis-appointment-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

.form-group input::placeholder,
.appointment-form-box .brxe-form input::placeholder,
.axis-appointment-form input::placeholder {
    color: var(--axis-text-placeholder);
}

/* iOS zoom prevention - form fields must be 16px minimum on mobile */
@media (max-width: 768px) {
    /* Minimal mobile styles - defaults are sufficient */
}

/* Submit button */
/* Form submit buttons - inherit from .btn-cta and .btn-primary in styles.css */
/* Only override sizing to keep form button slightly larger */
.btn-submit,
.appointment-form-box .brxe-form .bricks-button,
.appointment-form .bricks-button,
.axis-appointment-form .bricks-button {
    width: 100%;
    min-height: 60px;
    padding: var(--axis-space-5) var(--axis-space-10);
    font-size: var(--axis-text-lg);
    margin-top: var(--axis-space-2);
}

/* Add ::before circle animation for form buttons */
/* .btn-submit::before,
.appointment-form-box .brxe-form .bricks-button::before,
.appointment-form .bricks-button::before,
.axis-appointment-form .bricks-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.btn-submit:hover::before,
.appointment-form-box .brxe-form .bricks-button:hover::before,
.appointment-form .bricks-button:hover::before,
.axis-appointment-form .bricks-button:hover::before {
    width: 300px;
    height: 300px;
} */

/* ==========================================================================
   Responsive Design (Mobile-First Approach)
   ========================================================================== */

/* Base styles above are mobile-first (single column, center text)
   Progressive enhancement adds desktop features */

/* Tablet: Reduce gap between sections */
@media (min-width: 769px) and (max-width: 991px) {
    .welcome-booking-content {
        gap: var(--axis-space-6);
    }
}

/* Mobile: Form always expanded, larger touch targets */
@media (max-width: 768px) {

    /* Show form expanded by default for easier access */
    .form-wrapper {
        max-height: none;
        opacity: 1;
    }

    /* Hide toggle button and teaser fields on mobile - form always visible */
    .form-toggle-btn,
    .teaser-fields {
        display: none;
    }

    /* Adjust description spacing for mobile */
    .form-description {
        margin-bottom: var(--axis-space-4);
    }

    /* Ensure welcome box elements stack properly */
    .welcome-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Small mobile: Further reduce padding */
@media (max-width: 480px) {
    .form-title {
        font-size: var(--axis-text-xl);
        /* Smaller on tiny screens */
    }
}

/* ==========================================================================
   MOBILE HOMEPAGE OPTIMIZATION
   ========================================================================== */

/* TASK 6: Tighten spacing on mobile homepage */
/* TASK 9: Hide form container on mobile (form moved to popup modal) */
@media (max-width: 767px) {

    /* TASK 9: Hide form container on mobile - it's in the modal now */
    .welcome-booking-section .appointment-form-box {
        display: none !important;
    }

    /* Welcome box now full width (no grid split) */
    .welcome-booking-section .welcome-booking-content {
        display: block !important;
        width: 100%;
    }

    /* Center and tighten welcome box */
    .welcome-booking-section .welcome-box {
        text-align: center;
        padding: var(--axis-space-6);
        max-width: 100%;
        margin: 0 auto;
    }

    /* Tighter section spacing (TASK 6) */
    .welcome-booking-section {
        padding-top: var(--axis-space-6) !important;
        padding-bottom: var(--axis-space-6) !important;
        margin-top: -60px !important;
    }

    /* Make phone number super prominent */
    .welcome-booking-section .welcome-phone {
        font-size: var(--axis-text-xl) !important;
        font-weight: 600 !important;
        margin: var(--axis-space-3) 0 !important;
    }

    .welcome-booking-section .welcome-phone a {
        /* color: var(--axis-primary); */
        /* text-decoration: none; */
    }

    /* Welcome status badge */
    .welcome-booking-section .welcome-status-badge {
        padding: 6px 12px !important;
        font-size: var(--axis-text-sm) !important;
    }

    /* CTA button - full width, prominent */
    .welcome-booking-section .open-contact-modal {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--axis-space-2);
        width: 100%;
        max-width: 320px;
        padding: var(--axis-space-4) var(--axis-space-6) !important;
        background: var(--axis-primary);
        color: var(--axis-white);
        border: none;
        border-radius: 8px;
        font-weight: 600;
        font-size: var(--axis-text-lg);
        text-decoration: none;
        margin-top: var(--axis-space-4);
        cursor: pointer;
        transition: background 0.3s ease, transform 0.2s ease;
    }

    .welcome-booking-section .open-contact-modal:hover,
    .welcome-booking-section .open-contact-modal:focus {
        background: var(--axis-primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
    }

    .welcome-icon {
        /* display: none !important; */
    }
}