/* Forms Specific Styles */

/* Page Hero for internal pages */
.page-hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    margin-top: 80px;
}

.page-hero .hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
}

.page-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.1);
}

.page-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.page-hero .hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.page-hero .hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb-separator {
    opacity: 0.6;
}

.breadcrumb-current {
    font-weight: 500;
}

/* Forms Section */
.forms-section {
    padding: 6rem 0;
    background: var(--background-light);
}

.form-container {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
}

/* Form Tabs */
.form-tabs {
    display: flex;
    background: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    min-width: 180px;
    padding: 1.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.tab-button i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.tab-button:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.tab-button.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

.tab-button.completed {
    color: #10b981;
}

.tab-button.completed i::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 3rem;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--background-light);
}

.form-section h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
    font-size: 1.125rem;
}

.form-section h5 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Form Labels */
.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

/* Form Inputs */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: var(--transition-fast);
}

.checkbox-label:hover {
    color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: white;
    position: relative;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: var(--transition-fast);
}

.radio-label:hover {
    color: var(--primary-color);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: white;
    position: relative;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Question Items */
.question-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.question-item:last-child {
    border-bottom: none;
}

.question-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.question-item .radio-group {
    flex-shrink: 0;
}

/* Conditions Grid */
.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Special Sections */
.communication-preferences,
.emergency-contact,
.insured-information,
.secondary-insurance,
.consent-section {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
}

.insurance-details {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    margin-top: 1rem;
}

/* Consent Items */
.consent-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius-md);
    border-left: 4px solid var(--primary-color);
}

.consent-item h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.consent-item p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Signature Section */
.signature-section {
    background: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    margin-top: 2rem;
    border: 2px dashed var(--border-color);
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    background: var(--background-light);
    border-top: 1px solid var(--border-color);
}

/* Progress Bar */
.progress-container {
    padding: 1rem 3rem;
    background: var(--background-light);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-slow);
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.error-message::before {
    content: '⚠';
    flex-shrink: 0;
}

/* Success Messages */
.success-message {
    background: #10b981;
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message::before {
    content: '✓';
    flex-shrink: 0;
    font-weight: 700;
}

/* Loading State */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-hero {
        height: 40vh;
        min-height: 300px;
    }
    
    .form-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        min-width: auto;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 1rem 1.5rem;
    }
    
    .tab-button i {
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
    
    .tab-content {
        padding: 2rem 1.5rem;
    }
    
    .form-group-row {
        grid-template-columns: 1fr;
    }
    
    .form-navigation {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-container {
        padding: 1rem 1.5rem;
    }
    
    .question-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .conditions-grid {
        grid-template-columns: 1fr;
    }
    
    .communication-preferences,
    .emergency-contact,
    .insured-information,
    .secondary-insurance,
    .consent-section {
        padding: 1rem;
    }
    
    .consent-item {
        padding: 1rem;
    }
    
    .signature-section {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .page-hero .hero-title {
        font-size: 2rem;
    }
    
    .page-hero .hero-subtitle {
        font-size: 1rem;
    }
    
    .tab-content {
        padding: 1.5rem 1rem;
    }
    
    .form-navigation {
        padding: 1rem;
    }
    
    .progress-container {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .form-tabs,
    .form-navigation,
    .progress-container {
        display: none;
    }
    
    .page-hero {
        height: auto;
        padding: 2rem 0;
        margin-top: 0;
    }
    
    .tab-content {
        display: block !important;
        padding: 1rem 0;
        page-break-inside: avoid;
    }
    
    .form-section {
        page-break-inside: avoid;
    }
}