/**
 * Enhanced Appointment Booking Form Styles
 * File: public/assets/css/pages/appointmentbook.css
 * 
 * UPGRADES:
 * - Enhanced error states with animations
 * - Retry button styling
 * - Character counter for textarea
 * - Form alert component
 * - Improved accessibility states
 * - Smoother transitions and micro-interactions
 */

/* ==========================================================================
   APPOINTMENT BOOKING SECTION
   ========================================================================== */

.appointment-booking {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, 
        hsl(350, 70%, 98%) 0%, 
        hsl(0, 0%, 100%) 30%, 
        hsl(0, 0%, 100%) 100%);
    padding: 8rem 0 6rem;
    min-height: 100vh;
}

/* Background Effects */
.appointment-booking__background {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.appointment-booking__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

.appointment-booking__orb--primary {
    width: 500px;
    height: 500px;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, 
        hsl(350, 60%, 88%) 0%, 
        hsl(350, 50%, 90%) 100%);
    transform: translate(25%, -25%);
}

.appointment-booking__orb--secondary {
    width: 500px;
    height: 500px;
    bottom: 0;
    left: 0;
    background: linear-gradient(135deg, 
        hsl(220, 20%, 92%) 0%, 
        hsl(220, 15%, 95%) 100%);
    transform: translate(-25%, 25%);
    animation-delay: -10s;
}

/* Container */
.appointment-booking .container {
    position: relative;
    z-index: 1;
}

.appointment-booking__wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   BOOKING FORM CARD
   ========================================================================== */

.booking-form-card {
    background: hsl(0, 0%, 100%);
    border-radius: 1.5rem;
    box-shadow: 
        0 20px 25px -5px hsla(0, 0%, 0%, 0.05),
        0 10px 10px -5px hsla(0, 0%, 0%, 0.04);
    border: 1px solid hsl(220, 10%, 95%);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Bar */
.booking-form-card__status-bar {
    height: 8px;
    background: linear-gradient(90deg, 
        hsl(350, 80%, 60%) 0%, 
        hsl(270, 70%, 65%) 100%);
}

/* Content Padding */
.booking-form-card__content {
    padding: 2.5rem;
}

/* ==========================================================================
   FORM HEADER
   ========================================================================== */

.booking-form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Secure Badge */
.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, 
        hsl(350, 70%, 97%) 0%, 
        hsl(350, 80%, 95%) 100%);
    border: 1px solid hsl(350, 60%, 90%);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(350, 80%, 50%);
    margin-bottom: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.secure-badge i {
    font-size: 0.875rem;
}

/* Header Title */
.booking-form-header__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: hsl(220, 15%, 10%);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

/* Header Description */
.booking-form-header__description {
    font-size: 1rem;
    line-height: 1.6;
    color: hsl(220, 10%, 45%);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   FORM ALERT
   ========================================================================== */

.form-alert {
    display: none;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-alert--error {
    background: hsl(0, 70%, 97%);
    border: 1px solid hsl(0, 70%, 85%);
    color: hsl(0, 70%, 40%);
}

.form-alert--success {
    background: hsl(140, 70%, 97%);
    border: 1px solid hsl(140, 70%, 85%);
    color: hsl(140, 70%, 35%);
}

.form-alert__icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.form-alert--error .form-alert__icon {
    color: hsl(0, 70%, 50%);
}

.form-alert--success .form-alert__icon {
    color: hsl(140, 70%, 45%);
}

.form-alert__content {
    flex: 1;
}

.form-alert__message {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
}

.form-alert__close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.form-alert__close:hover {
    opacity: 1;
}

/* ==========================================================================
   REFERENCE INFO
   ========================================================================== */

.reference-info {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: hsl(220, 15%, 97%);
    border: 1px solid hsl(220, 10%, 92%);
    border-radius: 1rem;
    margin-bottom: 2.5rem;
}

.reference-info__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        hsl(220, 15%, 10%) 0%, 
        hsl(220, 15%, 20%) 100%);
    color: hsl(0, 0%, 100%);
    border-radius: 50%;
    font-size: 1.25rem;
}

.reference-info__content {
    flex: 1;
}

.reference-info__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(220, 10%, 50%);
    margin-bottom: 0.25rem;
}

.reference-info__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: hsl(220, 15%, 10%);
    line-height: 1.4;
}

/* ==========================================================================
   BOOKING FORM
   ========================================================================== */

.booking-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Form Section */
.form-section {
    padding-bottom: 2rem;
    border-bottom: 1px solid hsl(220, 10%, 93%);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(220, 15%, 15%);
    margin-bottom: 1.75rem;
}

.form-section__title i {
    color: hsl(350, 80%, 55%);
    font-size: 1rem;
}

/* Form Row (Grid Layout) */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
}

/* Form Label */
.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(220, 10%, 30%);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.form-label__required {
    color: hsl(350, 80%, 55%);
    font-weight: 700;
}

.form-label__optional {
    font-size: 0.8125rem;
    font-weight: 400;
    color: hsl(220, 10%, 55%);
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 0.875rem;
    color: hsl(220, 10%, 50%);
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

/* Form Input */
.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    font-weight: 400;
    color: hsl(220, 15%, 15%);
    background: hsl(0, 0%, 100%);
    border: 1.5px solid hsl(220, 10%, 88%);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 hsla(0, 0%, 0%, 0.03);
}

.form-input::placeholder {
    color: hsl(220, 10%, 65%);
    font-weight: 300;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: hsl(350, 80%, 55%);
    box-shadow: 
        0 0 0 3px hsla(350, 80%, 55%, 0.1),
        0 1px 2px 0 hsla(0, 0%, 0%, 0.05);
}

.form-input:focus + .input-icon,
.form-select:focus + .input-icon {
    color: hsl(350, 80%, 55%);
}

.form-input:disabled,
.form-select:disabled {
    background: hsl(220, 10%, 97%);
    color: hsl(220, 10%, 55%);
    cursor: not-allowed;
}

/* Error State */
.input-wrapper.has-error .form-input,
.input-wrapper.has-error .form-select {
    border-color: hsl(0, 70%, 55%);
    background: hsl(0, 70%, 99%);
}

.input-wrapper.has-error .input-icon {
    color: hsl(0, 70%, 55%);
}

.input-error {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: hsl(0, 70%, 50%);
    font-weight: 500;
    min-height: 1.25rem;
}

/* Form Select */
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

/* Form Textarea */
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    color: hsl(220, 15%, 15%);
    background: hsl(0, 0%, 100%);
    border: 1.5px solid hsl(220, 10%, 88%);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 hsla(0, 0%, 0%, 0.03);
    resize: vertical;
    font-family: inherit;
}

.form-textarea::placeholder {
    color: hsl(220, 10%, 65%);
    font-weight: 300;
}

.form-textarea:focus {
    outline: none;
    border-color: hsl(350, 80%, 55%);
    box-shadow: 
        0 0 0 3px hsla(350, 80%, 55%, 0.1),
        0 1px 2px 0 hsla(0, 0%, 0%, 0.05);
}

/* Character Counter */
.char-counter {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: hsl(220, 10%, 55%);
    text-align: right;
}

/* Slot Loader */
.slot-loader {
    position: absolute;
    right: 3rem;
    top: 0.875rem;
    display: none;
}

.input-wrapper.is-loading .slot-loader {
    display: block;
}

.input-wrapper.is-loading .form-select {
    padding-right: 5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid hsl(220, 10%, 90%);
    border-top-color: hsl(350, 80%, 55%);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading & Error States */
.input-wrapper.is-error .form-select {
    border-color: hsl(0, 70%, 55%);
    background-color: hsl(0, 70%, 98%);
}

/* Retry Button */
.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(350, 80%, 55%);
    background: hsl(350, 80%, 98%);
    border: 1px solid hsl(350, 70%, 90%);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    background: hsl(350, 80%, 95%);
    border-color: hsl(350, 70%, 80%);
    transform: translateY(-1px);
}

.btn-retry:active {
    transform: translateY(0);
}

.btn-retry i {
    animation: rotate 1s ease-in-out;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   FORM SUBMIT
   ========================================================================== */

.form-submit {
    padding-top: 1.5rem;
}

/* Submit Button */
.btn-submit {
    position: relative;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: hsl(0, 0%, 100%);
    background: linear-gradient(135deg, 
        hsl(220, 15%, 10%) 0%, 
        hsl(220, 15%, 20%) 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 
        0 10px 15px -3px hsla(0, 0%, 0%, 0.15),
        0 4px 6px -2px hsla(0, 0%, 0%, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 20px 25px -5px hsla(0, 0%, 0%, 0.2),
        0 10px 10px -5px hsla(0, 0%, 0%, 0.1);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled,
.btn-submit.is-submitting {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit__text,
.btn-submit__icon {
    position: relative;
    z-index: 1;
}

.btn-submit__icon {
    transition: transform 0.3s ease;
}

.btn-submit:hover:not(:disabled) .btn-submit__icon {
    transform: translateX(4px);
}

/* Button Shine Effect */
.btn-submit__shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        hsla(0, 0%, 100%, 0.3) 50%, 
        transparent 100%);
    transform: skewX(-15deg);
    transition: left 0.6s ease;
}

.btn-submit:hover:not(:disabled) .btn-submit__shine {
    left: 100%;
}

/* Form Disclaimer */
.form-disclaimer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8125rem;
    color: hsl(220, 10%, 55%);
    line-height: 1.5;
}

/* ==========================================================================
   BOOKING SIDEBAR (TRUST INDICATORS)
   ========================================================================== */

.booking-sidebar {
    display: none;
}

/* Trust Indicator */
.trust-indicator {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: hsl(0, 0%, 100%);
    border: 1px solid hsl(220, 10%, 93%);
    border-radius: 1rem;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.trust-indicator:hover {
    border-color: hsl(350, 60%, 85%);
    box-shadow: 
        0 4px 6px -1px hsla(0, 0%, 0%, 0.05),
        0 2px 4px -1px hsla(0, 0%, 0%, 0.03);
    transform: translateY(-2px);
}

.trust-indicator__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        hsl(350, 80%, 55%) 0%, 
        hsl(340, 75%, 60%) 100%);
    color: hsl(0, 0%, 100%);
    border-radius: 0.75rem;
    font-size: 1.25rem;
    box-shadow: 
        0 4px 6px -1px hsla(350, 80%, 55%, 0.3),
        0 2px 4px -1px hsla(350, 80%, 55%, 0.2);
}

.trust-indicator:nth-child(2) .trust-indicator__icon {
    background: linear-gradient(135deg, 
        hsl(140, 70%, 45%) 0%, 
        hsl(140, 70%, 50%) 100%);
    box-shadow: 
        0 4px 6px -1px hsla(140, 70%, 45%, 0.3),
        0 2px 4px -1px hsla(140, 70%, 45%, 0.2);
}

.trust-indicator:nth-child(3) .trust-indicator__icon {
    background: linear-gradient(135deg, 
        hsl(270, 70%, 55%) 0%, 
        hsl(270, 70%, 60%) 100%);
    box-shadow: 
        0 4px 6px -1px hsla(270, 70%, 55%, 0.3),
        0 2px 4px -1px hsla(270, 70%, 55%, 0.2);
}

.trust-indicator__content {
    flex: 1;
}

.trust-indicator__title {
    font-size: 1rem;
    font-weight: 700;
    color: hsl(220, 15%, 10%);
    margin-bottom: 0.375rem;
}

.trust-indicator__description {
    font-size: 0.875rem;
    line-height: 1.5;
    color: hsl(220, 10%, 45%);
}

/* Operating Info */
.operating-info {
    padding: 2rem;
    background: linear-gradient(135deg, 
        hsl(220, 15%, 15%) 0%, 
        hsl(220, 15%, 20%) 100%);
    color: hsl(0, 0%, 100%);
    border-radius: 1rem;
    text-align: center;
    box-shadow: 
        0 10px 15px -3px hsla(0, 0%, 0%, 0.2),
        0 4px 6px -2px hsla(0, 0%, 0%, 0.1);
}

.operating-info__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    color: hsl(350, 70%, 75%);
}

.operating-info__title i {
    font-size: 1rem;
}

.operating-info__hours {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.75rem;
    color: hsl(0, 0%, 90%);
}

.operating-info__hours strong {
    font-weight: 700;
    font-size: 1.25rem;
    color: hsl(0, 0%, 100%);
    display: block;
    margin-bottom: 0.5rem;
}

/* WhatsApp Link */
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    background: hsl(140, 70%, 45%);
    color: hsl(0, 0%, 100%);
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-link:hover {
    background: hsl(140, 70%, 40%);
    transform: translateY(-2px);
    box-shadow: 
        0 10px 15px -3px hsla(140, 70%, 45%, 0.3),
        0 4px 6px -2px hsla(140, 70%, 45%, 0.2);
}

.whatsapp-link i {
    font-size: 1.25rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .booking-form-card__content {
        padding: 3rem;
    }
}

@media (min-width: 1024px) {
    .appointment-booking__wrapper {
        grid-template-columns: 2fr 1fr;
        gap: 2.5rem;
    }

    .booking-sidebar {
        display: block;
    }

    .booking-form-card__content {
        padding: 3.5rem;
    }
}

@media (max-width: 767px) {
    .appointment-booking {
        padding: 6rem 0 4rem;
    }

    .booking-form-card__content {
        padding: 2rem 1.5rem;
    }

    .booking-form-header__title {
        font-size: 1.75rem;
    }

    .booking-form-header__description {
        font-size: 0.9375rem;
    }

    .reference-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .reference-info__icon {
        margin: 0 auto;
    }

    .form-section__title {
        font-size: 0.8125rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 0.9375rem;
    }

    .btn-submit {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .booking-form-card__content {
        padding: 1.75rem 1.25rem;
    }

    .secure-badge {
        font-size: 0.6875rem;
        padding: 0.375rem 1rem;
    }

    .reference-info {
        padding: 1rem 1.25rem;
    }

    .reference-info__icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   ACCESSIBILITY & REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States for Keyboard Navigation */
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.btn-submit:focus-visible,
.btn-retry:focus-visible,
.whatsapp-link:focus-visible {
    outline: 3px solid hsl(350, 80%, 55%);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 2px;
    }

    .btn-submit {
        border: 2px solid hsl(0, 0%, 100%);
    }
    
    .form-alert {
        border-width: 2px;
    }
}