/* Brand Colors */
:root {
    --brand-orange: rgb(237, 153, 56);
    --brand-green: rgb(186, 212, 122);
    --brand-blue: rgb(69, 172, 235);
    --brand-orange-light: rgba(237, 153, 56, 0.1);
    --brand-green-light: rgba(186, 212, 122, 0.1);
    --brand-blue-light: rgba(69, 172, 235, 0.1);
    --text-dark: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Custom Button Styles */
.btn-primary {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: rgba(69, 172, 235, 0.9);
    border-color: rgba(69, 172, 235, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(69, 172, 235, 0.3);
}

.btn-outline-secondary {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
    color: white;
    transform: translateY(-2px);
}

/* Navigation Bar */
.navbar-dark.bg-primary {
    background-color: var(--brand-blue) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Prevent icon and label from splitting onto separate lines */
.navbar .nav-link {
    white-space: nowrap;
}

/* Progress Indicator */
.progress-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 1rem;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
}

.step.active .step-number {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
    box-shadow: 0 0 0 4px var(--brand-blue-light);
}

.step.completed .step-number {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: white;
}

.step-name {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    color: #6c757d;
    min-width: 80px;
}

.step.active .step-name {
    color: var(--brand-blue);
    font-weight: 700;
}

.step.completed .step-name {
    color: var(--brand-green);
}

/* Form Styling */
.step-content {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.step-title {
    color: var(--brand-blue);
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.step-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid var(--brand-orange-light);
    position: relative;
}

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

/* Remove border from last section in optional container */
#optionalFieldsContainer .form-section:last-child {
    border-bottom: none;
    margin-bottom: 1rem;
}

#optionalFieldsContainer .form-section:last-child::after {
    display: none;
}

.form-section::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--brand-orange);
    border-radius: 2px;
}

.section-title {
    color: var(--brand-orange);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--brand-orange);
    margin-right: 0.75rem;
    border-radius: 2px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.required {
    color: var(--error-color);
    font-weight: 700;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 0.2rem var(--brand-blue-light);
    background-color: white;
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Pronouns Grid */
.pronouns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.form-check {
    display: flex;
    align-items: flex-start;
    padding: 0.6rem 0.85rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #fafafa;
    margin: 0;
    min-height: 44px;
    cursor: pointer;
    position: relative;
}

.form-check:hover {
    border-color: var(--brand-green);
    background-color: var(--brand-green-light);
}

.form-check.checked {
    border-color: var(--brand-green);
    background-color: var(--brand-green-light);
    box-shadow: 0 2px 4px rgba(186, 212, 122, 0.2);
}

.form-check-input {
    margin: 0;
    margin-right: 0.65rem;
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.form-check-input:checked {
    background-color: var(--brand-green);
    border-color: var(--brand-green);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem var(--brand-green-light);
}

.form-check-label {
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    flex: 1;
    cursor: pointer;
    user-select: none;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

/* Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 2px solid var(--brand-blue-light);
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.alert-success {
    background: var(--brand-green-light);
    color: #2d5a2d;
    border-left: 4px solid var(--brand-green);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: var(--brand-blue-light);
    color: #1e3a8a;
    border-left: 4px solid var(--brand-blue);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

/* Hero Section */
.hero-section {
    background-color: var(--brand-blue);
    color: white;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: white !important;
}

.hero-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: white !important;
}

.hero-section * {
    color: white !important;
}

/* Error Messages */
.error-list {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid var(--error-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.error-list ul {
    margin: 0;
    padding-left: 1.5rem;
}

.error-list li {
    color: var(--error-color);
    font-weight: 500;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .step-content {
        padding: 1.5rem;
    }
    
    .progress-container {
        padding: 1.5rem;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .step-name {
        font-size: 0.75rem;
        min-width: 60px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pronouns-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .step-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .pronouns-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation Enhancements */
.step-content {
    animation: slideInUp 0.3s ease; /* Reduced from 0.5s to 0.3s */
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(15px); /* Reduced from 30px to 15px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form validation styling */
.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: var(--brand-green);
    background-image: none;
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--error-color);
    background-image: none;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Focus indicators for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

/* Ensure good contrast on colored backgrounds */
.bg-primary,
.btn-primary,
.alert-primary,
[style*="background-color: var(--brand-blue)"],
[style*="background-color: var(--brand-orange)"],
[style*="background-color: var(--brand-green)"] {
    color: white !important;
}

.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-primary h5,
.bg-primary h6,
.bg-primary p,
.bg-primary span:not(.badge),
.bg-primary div {
    color: white !important;
}

/* Ensure badges have proper contrast */
.badge.bg-primary {
    background-color: #0d6efd !important;
    color: white !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

/* Override Bootstrap's muted text on colored backgrounds */
.text-muted {
    color: var(--text-muted) !important;
}

[style*="background-color: var(--brand-blue)"] .text-muted,
[style*="background-color: var(--brand-orange)"] .text-muted,
[style*="background-color: var(--brand-green)"] .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Print styles */
@media print {
    .progress-container,
    .form-navigation,
    .navbar {
        display: none !important;
    }
    
    .step-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
