/* ============================================
   Patient Intake Form Styles
   ============================================ */

/* Hero Section */
.form-hero {
    background: linear-gradient(135deg, #2D3A4C 0%, #1F2933 100%);
    color: white;
    text-align: center;
    padding: 8rem 2rem 4rem;
    min-height: 350px;
    position: relative;
}

.form-hero__container {
    max-width: 900px;
    margin: 0 auto;
}

.form-hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 700;
}

.form-hero p {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 0;
    line-height: 1.6;
}

.hipaa-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 750px;
    margin: 2.5rem auto 0;
    font-size: 0.95rem;
    text-align: left;
    backdrop-filter: blur(10px);
}

.hipaa-notice svg {
    flex-shrink: 0;
    opacity: 0.9;
}

/* Form Container */
.form-container {
    max-width: 900px;
    margin: 4rem auto 6rem;
    padding: 0 2rem;
}

/* Form Sections */
.form-section {
    background: white;
    border-radius: 16px;
    padding: 3rem 3rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.form-section__heading {
    font-size: 1.75rem;
    color: var(--color-primary-blue, #2D3A4C);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 1rem;
    border-bottom: 3px solid #e5e7eb;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6980B5 0%, #5470A5 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.subsection-heading {
    font-size: 1.25rem;
    color: var(--color-primary-blue, #2D3A4C);
    margin: 2rem 0 1.5rem;
    font-weight: 600;
}

.section-instructions {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary-blue, #2D3A4C);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6980B5;
    box-shadow: 0 0 0 3px rgba(105, 128, 181, 0.1);
}

.form-group input:valid,
.form-group select:valid,
.form-group textarea:valid {
    border-color: #92CAAF;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Checkbox Grid for Medical History */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.checkbox-label:hover {
    background: #f3f4f6;
    border-color: #6980B5;
}

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

.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--color-primary-blue, #2D3A4C);
}

.checkbox-label--large {
    padding: 16px 20px;
    font-size: 1rem;
    background: #fef3c7;
    border-color: #fbbf24;
}

.checkbox-label--large:hover {
    background: #fde68a;
}

.checkbox-label--large input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

/* Consent Text */
.consent-text {
    background: #f9fafb;
    border-left: 4px solid #6980B5;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.consent-text p {
    margin: 0 0 1rem;
    line-height: 1.7;
    color: #374151;
}

.consent-text p:last-child {
    margin-bottom: 0;
}

/* Submit Button */
.form-actions {
    text-align: center;
    margin-top: 3rem;
}

.form-submit {
    display: inline-block;
    padding: 18px 60px;
    background: linear-gradient(90deg, #6980B5 0%, #6980B5 50%, #2D3A4C 50%, #2D3A4C 100%);
    background-size: 200%;
    background-position: 100% 0;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 16px rgba(105, 128, 181, 0.3);
}

.form-submit:hover {
    background-position: 0 0;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(105, 128, 181, 0.4);
}

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

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

.form-notice {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

/* Validation States */
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input.error,
select.error,
textarea.error {
    border-color: #ef4444;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 640px) {
    .form-hero {
        padding: 7rem 1.5rem 3rem;
        min-height: 300px;
    }

    .form-hero h1 {
        font-size: 2rem;
    }

    .form-hero p {
        font-size: 1rem;
    }

    .hipaa-notice {
        flex-direction: column;
        text-align: center;
        padding: 16px 20px;
        font-size: 0.875rem;
    }

    .form-container {
        margin: 3rem auto 4rem;
        padding: 0 1.5rem;
    }

    .form-section {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }

    .form-section__heading {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-number {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .form-submit {
        width: 100%;
        padding: 16px 40px;
        font-size: 1rem;
    }
}

/* Loading State */
.form-submit.loading {
    position: relative;
    color: transparent;
}

.form-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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