/**
 * Contact Form Styles for Qi Traditional Chinese Medicine
 * Includes validation states, error messages, and success feedback
 */

/* Form Messages */
.form-messages {
    margin-bottom: 2rem;
}

.form-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-message--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message--error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-icon {
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1;
}

.message-text {
    flex: 1;
    line-height: 1.5;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c5a2c;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5a2c;
    box-shadow: 0 0 0 3px rgba(44, 90, 44, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Error States */
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-group.has-error input:focus,
.form-group.has-error textarea:focus,
.form-group.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.error-message {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

/* Checkbox groups */
.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    cursor: pointer;
}

/* Multi-select Checkbox Groups */
.checkbox-group {
    margin-bottom: 2rem;
}

.checkbox-group .group-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #2c5a2c;
    font-size: 1rem;
}

.checkbox-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
    margin: 0;
}

.checkbox-label:hover {
    background-color: #f0f8f0;
    border-color: #2c5a2c;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    accent-color: #2c5a2c;
}

.checkbox-label span {
    flex: 1;
    line-height: 1.4;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 500;
    color: #2c5a2c;
}

/* Error state for checkbox groups */
.checkbox-group.has-error .checkbox-options {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.checkbox-group.has-error .group-label {
    color: #dc3545;
}

/* Submit Button States */
.contact-form button[type="submit"] {
    width: 100%;
    padding: 14px 32px;
    background-color: #2c5a2c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-form button[type="submit"]:hover:not(:disabled) {
    background-color: #234a23;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 90, 44, 0.3);
}

.contact-form button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
}

.contact-form button[type="submit"]:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Honeypot field (anti-spam) */
input[name="_honey"] {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 50px;
    }
}

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

@keyframes highlightForm {
    0%, 100% {
        color: inherit;
    }
    50% {
        color: #2c5a2c;
        text-shadow: 0 0 20px rgba(44, 90, 44, 0.3);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-message {
        padding: 12px 16px;
        gap: 8px;
    }

    .message-icon {
        font-size: 1.25rem;
    }

    /* Mobile responsive for checkbox groups */
    .checkbox-options {
        grid-template-columns: 1fr;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .checkbox-label {
        padding: 10px 12px;
    }

    .checkbox-label span {
        font-size: 0.9rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .form-message,
    .error-message,
    .spinner {
        animation: none;
    }

    .contact-form button[type="submit"]:hover:not(:disabled) {
        transform: none;
    }
}

/* Success state for completed fields */
.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown),
.form-group select:valid {
    border-color: #28a745;
}

.form-group.has-error input:valid:not(:placeholder-shown),
.form-group.has-error textarea:valid:not(:placeholder-shown) {
    border-color: #dc3545;
}

/* Print styles */
@media print {
    .form-messages,
    .contact-form button {
        display: none;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        background-color: #2d2d2d;
        color: #fff;
        border-color: #555;
    }

    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        border-color: #4a8a4a;
    }

    .form-message--success {
        background-color: #1e4620;
        color: #b6e4b8;
        border-color: #2d6930;
    }

    .form-message--error {
        background-color: #4a1f1f;
        color: #f5c2c7;
        border-color: #6a2929;
    }
}

/* ========================================
   Contact Form Header Styling
   ======================================== */

.contact-form-section {
    background: linear-gradient(135deg, #f0f8f0 0%, #ffffff 100%);
    border: 2px solid #d4e8d4;
    border-radius: 16px;
    padding: 3rem;
    margin: 3rem 0;
    box-shadow: 0 4px 20px rgba(44, 90, 44, 0.1);
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #2c5a2c;
}

.form-header h2 {
    color: #2c5a2c;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-subtitle {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .contact-form-section {
        padding: 2rem 1.5rem;
    }

    .form-header h2 {
        font-size: 1.75rem;
    }

    .form-subtitle {
        font-size: 1rem;
    }
}

/* ========================================
   Contact Information Cards
   ======================================== */

.contact-cards {
    margin: 3rem 0;
}

.contact-cards .section-title {
    text-align: center;
    font-size: 2rem;
    color: #2c5a2c;
    margin-bottom: 2.5rem;
    font-weight: 700;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(44, 90, 44, 0.15);
    border-color: #2c5a2c;
}

.card-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.info-card h3 {
    color: #2c5a2c;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-primary {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.card-primary a {
    color: #2c5a2c;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-primary a:hover {
    color: #1a3a1a;
    text-decoration: underline;
}

.card-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin-top: 0.75rem;
}

.hours-list {
    text-align: left;
    display: inline-block;
}

.hours-list p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.hours-list strong {
    color: #2c5a2c;
    font-weight: 600;
}

/* Responsive Cards */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1.5rem;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    .contact-cards .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
}

/* ========================================
   What to Expect Section
   ======================================== */

.expectations-section {
    margin: 4rem 0;
}

.expectations-section .section-title {
    text-align: center;
    font-size: 2rem;
    color: #2c5a2c;
    margin-bottom: 2.5rem;
    font-weight: 700;
}

.expectations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.expectation-card {
    background: linear-gradient(135deg, #f0f8f0 0%, #ffffff 100%);
    border: 2px solid #d4e8d4;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.expectation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(44, 90, 44, 0.15);
    border-color: #2c5a2c;
}

.expectation-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.expectation-card h3 {
    color: #2c5a2c;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.expectation-card p {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ========================================
   Insurance & Payment Section
   ======================================== */

.payment-section {
    margin: 4rem 0;
    background: linear-gradient(135deg, #2c5a2c 0%, #1a3a1a 100%);
    border-radius: 16px;
    padding: 3rem;
    color: white;
}

.payment-container {
    max-width: 900px;
    margin: 0 auto;
}

.payment-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-icon {
    font-size: 3rem;
    line-height: 1;
}

.payment-section h2 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.payment-intro {
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.payment-options {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.payment-options h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.payment-methods {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.payment-method {
    background: white;
    color: #2c5a2c;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1 1 auto;
    min-width: 180px;
}

.payment-method:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.payment-note {
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 1.5rem;
}

/* ========================================
   Emergency Alert Section
   ======================================== */

.emergency-alert {
    margin: 4rem 0;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 3px solid #ffc107;
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.alert-icon {
    font-size: 3.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.alert-content h2 {
    color: #856404;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.alert-primary {
    color: #721c24;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.alert-primary strong {
    font-weight: 700;
}

.alert-secondary {
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Responsive Sections */
@media (max-width: 768px) {
    .expectations-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .expectation-card {
        padding: 1.5rem;
    }

    .payment-section {
        padding: 2rem 1.5rem;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .emergency-alert {
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
        text-align: center;
    }

    .alert-icon {
        font-size: 3rem;
    }

    .expectations-section .section-title,
    .payment-section h2,
    .alert-content h2 {
        font-size: 1.5rem;
    }
}
