/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Metallic Blue/Grey/White Theme */
    --primary-blue: #2563eb;
    --primary-blue-light: #3b82f6;
    --primary-blue-dark: #1d4ed8;
    --metallic-silver: #e5e7eb;
    --metallic-grey: #6b7280;
    --metallic-dark: #374151;
    --metallic-light: #f9fafb;
    --white: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #d1d5db;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
    --gradient-metallic: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-metallic);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.form-header {
    background: var(--gradient-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    position: relative;
    z-index: 2;
}

.church-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-heavy);
    flex-shrink: 0;
}

.church-logo i {
    font-size: 32px;
    color: var(--white);
}

.header-text h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-text p {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
}

.header-decoration {
    position: absolute;
    top: 0;
    right: -50px;
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.1) 70%);
    border-radius: 50%;
    z-index: 1;
}

/* Main Form Styles */
.form-main {
    flex: 1;
    padding: 40px 30px;
}

.intake-form {
    background: var(--gradient-card);
    border-radius: 16px;
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Section Styles */
.form-section {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.form-section:last-child {
    border-bottom: none;
}

.section-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--metallic-light) 0%, var(--metallic-silver) 100%);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.section-header:hover {
    background: linear-gradient(135deg, var(--metallic-silver) 0%, var(--metallic-light) 100%);
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 16px;
    box-shadow: var(--shadow-light);
}

.section-toggle {
    font-size: 18px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.section-content {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    background: var(--white);
}

/* Field Styles */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.field-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-label .required {
    color: #ef4444;
    font-size: 12px;
}

.field-input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--white);
    transition: all 0.3s ease;
    font-family: inherit;
}

.field-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--metallic-light);
}

.field-input::placeholder {
    color: var(--text-secondary);
}

textarea.field-input {
    resize: vertical;
    min-height: 100px;
}

/* Select Styling */
select.field-input {
    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 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Radio and Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: var(--primary-blue-light);
    background: var(--metallic-light);
}

.radio-option input,
.checkbox-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-blue);
}

.radio-option label,
.checkbox-option label {
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
}

/* Form Actions */
.form-actions {
    padding: 30px;
    background: var(--gradient-metallic);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    box-shadow: var(--shadow-light);
}

.btn-primary {
    background: var(--gradient-blue);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--metallic-light);
    border-color: var(--metallic-grey);
    transform: translateY(-1px);
}

/* Footer */
.form-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    background: var(--gradient-metallic);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    text-align: center;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-heavy);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
}

.modal-header {
    padding: 24px;
    text-align: center;
    background: var(--gradient-blue);
    color: var(--white);
}

.modal-header i {
    font-size: 48px;
    margin-bottom: 12px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    text-align: center;
    color: var(--text-primary);
}

.modal-footer {
    padding: 20px 24px;
    text-align: center;
    background: var(--metallic-light);
}

/* Field Validation */
.field-input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.checkbox-group.error,
.radio-group.error {
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 8px;
    background: #fef2f2;
}

.checkbox-group.error .checkbox-option,
.radio-group.error .radio-option {
    border-color: #ef4444;
}

.field-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

/* Conditional Fields */
.field-hidden {
    display: none !important;
}

/* Error Notification */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    animation: slideInRight 0.3s ease;
}

.error-content {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
}

.error-content i {
    font-size: 18px;
}

.close-error {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.close-error:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }
    
    .header-content {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .church-logo {
        width: 60px;
        height: 60px;
    }
    
    .church-logo i {
        font-size: 24px;
    }
    
    .header-text h1 {
        font-size: 24px;
    }
    
    .form-main {
        padding: 20px 16px;
    }
    
    .section-content {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        padding: 20px;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 16px;
    }
    
    .section-header {
        padding: 20px;
    }
    
    .section-content {
        padding: 16px;
    }
}
