:root {
    --primary: #0E1B4D;
    --primary-dark: #00001f;
    --primary-light: #13C5DD;
    --primary-subtle: #e1f9fc;
    --secondary: #475467;
    --success: #027A48;
    --warning: #FFAD0F;
    --error: #D92D20;
    --surface: #FFFFFF;
    --surface-secondary: #F8FAFC;
    --surface-tertiary: #F1F5F9;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --border: #E2E8F0;
    --border-light: #e2e8f0;
    --success: #22C55E;
    --error: #EF4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --usa-red: #B91C1C;
    --usa-blue: #1E40AF;
    --usa-flag: linear-gradient(135deg, #1E40AF 0%, #B91C1C 50%, #FFFFFF 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: var(--surface-secondary);
    line-height: 1.6;
}

/* Clean USA Theme Elements */
.usa-flag-badge {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 53, 0.15);
}

.usa-header-badge {
    text-align: center;
    margin-bottom: 1rem;
}

.usa-icon {
    background: var(--primary-subtle);
}

/* Top Bar Styles */
.top-bar {
    background-color: var(--primary);
    color: #ffffff;
    padding: 1rem 0;
}

.top-bar a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
}

.top-bar a:hover {
    color: var(--primary-light);
}

.top-bar .fa-envelope, .top-bar .fa-phone-alt {
    color: var(--primary-light);
}

/* Navbar Styles */
.navbar {
    background-color: #ffffff;
    box-shadow: var(--shadow-md);
}

.navbar-brand img {
    height: 60px;
}

.nav-link {
    color: var(--primary);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-light);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--primary);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: var(--primary-subtle);
    color: var(--primary-light);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
    color: #ffffff;
    border-color: var(--primary-light);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

/* Clean Button Styles - From Original Style File */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    padding: 10px 24px;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 53, 0.25);
}

.btn-outline-light {
    color: var(--secondary);
    border-color: var(--border);
    background-color: white;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
}

.btn-outline-light:hover:not(:disabled) {
    background-color: var(--surface-tertiary);
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Main Content Area */
.main-content {
    padding: 2rem 0;
    min-height: 70vh;
}

.form-panel {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    position: sticky;
    top: 2rem;
    height: fit-content;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.form-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.15);
}

.form-panel h3 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.form-panel .text-muted {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-control {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(19, 197, 221, 0.1);
    outline: none;
}

/* Results Container */
.results-container {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    position: relative;
}

.results-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--usa-flag);
}

.results-header {
    padding: 2rem;
    text-align: center;
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border);
}

.results-header h2 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.results-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* Feature Cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-subtle) 0%, rgba(19, 197, 221, 0.1) 100%);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-lg);
}

.feature-list {
    list-style: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feature-list li {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: 600;
}

/* Progress Tracker */
.progress-tracker {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    position: relative;
}

.progress-tracker::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border: 3px solid var(--surface-secondary);
}

.step-number.active {
    background: var(--primary-light);
    color: white;
}

.step-number.completed {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 100px;
}

.step-label.active {
    color: var(--primary);
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 2rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-light);
    width: 0%;
    transition: width 0.5s ease;
}

.analysis-overview {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.next-steps {
    background: var(--primary-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 2rem;
    border-left: 4px solid var(--primary-light);
}

.next-steps h4 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.next-steps ol {
    padding-left: 1.5rem;
}

.next-steps li {
    margin-bottom: 0.5rem;
}

.estimated-time {
    display: inline-block;
    background: rgba(19, 197, 221, 0.1);
    color: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Loading State */
.loading-container {
    padding: 3rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.loading-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* API Status Grid */
.api-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.api-status-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.api-status-card.connecting {
    border-color: var(--warning);
    background: #FFFBEB;
    animation: pulse 2s infinite;
}

.api-status-card.connected {
    border-color: var(--success);
    background: #F0FDF4;
}

.api-status-card.error {
    border-color: var(--error);
    background: #FEF2F2;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.api-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.api-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.api-status-card.connecting .api-status-icon {
    background: var(--warning);
    color: white;
}

.api-status-card.connected .api-status-icon {
    background: var(--success);
    color: white;
}

.api-status-card.error .api-status-icon {
    background: var(--error);
    color: white;
}

/* Analysis Results */
.analysis-results {
    padding: 2rem;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.analysis-meta {
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    font-size: 0.9rem;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-secondary);
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    border: 1px solid var(--border);
}

.progress-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Category Sections */
.category-section {
    background: var(--surface);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
    animation: slideInModern 0.6s ease-out forwards;
    box-shadow: var(--shadow-md);
    position: relative;
}

@keyframes slideInModern {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section:nth-child(1) { animation-delay: 0.1s; }
.category-section:nth-child(2) { animation-delay: 0.2s; }
.category-section:nth-child(3) { animation-delay: 0.3s; }
.category-section:nth-child(4) { animation-delay: 0.4s; }
.category-section:nth-child(5) { animation-delay: 0.5s; }
.category-section:nth-child(6) { animation-delay: 0.6s; }
.category-section:nth-child(7) { animation-delay: 0.7s; }
.category-section:nth-child(8) { animation-delay: 0.8s; }
.category-section:nth-child(9) { animation-delay: 0.9s; }
.category-section:nth-child(10) { animation-delay: 1.0s; }
.category-section:nth-child(11) { animation-delay: 1.1s; }
.category-section:nth-child(12) { animation-delay: 1.2s; }
.category-section:nth-child(13) { animation-delay: 1.3s; }
.category-section:nth-child(14) { animation-delay: 1.4s; }
.category-section:nth-child(15) { animation-delay: 1.5s; }
.category-section:nth-child(16) { animation-delay: 1.6s; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
}

.category-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-section:hover::before {
    opacity: 1;
}

.category-header {
    background: var(--surface-secondary);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.category-number {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.category-title {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.category-toggle {
    margin-left: auto;
    font-size: 1rem;
    color: var(--primary-light);
    transition: transform 0.3s ease;
}

.category-toggle.collapsed {
    transform: rotate(-90deg);
}

.category-content {
    padding: 1.5rem;
    display: none;
    transition: all 0.3s ease;
}

.category-content.active {
    display: block;
}

.category-toggle {
    transition: transform 0.3s ease;
}

.category-toggle.rotated {
    transform: rotate(180deg);
}

.requirement-grid {
    display: grid;
    gap: 1rem;
}

.requirement-field {
    background: var(--surface-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-light);
    position: relative;
}

.requirement-field.completed::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.25rem;
    color: var(--success);
    font-weight: bold;
    animation: fadeInCheck 0.5s ease-in;
}

@keyframes fadeInCheck {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

.field-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-content {
    color: var(--text-primary);
    line-height: 1.5;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

/* Download Section */
.download-section {
    background: var(--primary);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    margin: 2rem 0;
    text-align: center;
}

.download-section h3 {
    margin-bottom: 1rem;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-download {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
}

.btn-download:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

/* Error State */
.error-container {
    text-align: center;
    padding: 3rem 2rem;
}

.error-icon {
    width: 64px;
    height: 64px;
    background: #FEE2E2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

.error-container h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.error-container ul {
    text-align: left;
    max-width: 400px;
    margin: 1.5rem auto;
    color: var(--text-secondary);
}

/* Footer Styles */
.footer-section {
    background-color: var(--primary);
    color: #ffffff;
    padding: 40px 0;
}

.footer-section .footer-logo img {
    max-height: 50px;
    max-width: 180px;
    object-fit: contain;
}

.footer-section h5 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

.footer-section .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-section .col-20 {
    flex: 0 0 20%;
    max-width: 20%;
    margin-bottom: 20px;
}

.footer-section p.small {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style-type: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.3s ease;
    text-transform: capitalize;
    font-size: 0.8rem;
}

.footer-section ul li a:hover {
    color: var(--primary-light);
}

.newsletter-form input {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
}

.newsletter-form button {
    width: 100%;
    padding: 8px;
    background-color: var(--primary-light);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #05b8b1;
}

.footer-bottom {
    margin-top: 20px;
    border-top: 1px solid #2c3e6f;
    padding-top: 15px;
}

.footer-bottom a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.8rem;
}

.footer-bottom a:hover {
    color: var(--primary-light);
}

.notification {
    position: relative;
    top: 80px;
    right: 1rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1031;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-bottom: 0.5rem;
    pointer-events: auto;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--error);
}

.notification.warning {
    background: var(--warning);
    color: var(--text-primary);
}

.notification.info {
    background: var(--primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 767px) {
    .top-bar {
        display: none;
    }

    .navbar-brand img {
        height: 50px;
    }

    .main-content .container {
        padding: 0 1rem;
    }

    .form-panel {
        position: static;
        margin-bottom: 2rem;
    }

    .results-header h2 {
        font-size: 1.5rem;
    }

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-download {
        width: 100%;
        max-width: 300px;
    }

    .notification {
        width: calc(100% - 2rem);
        right: 1rem;
        transform: translateX(calc(100% + 2rem));
    }

    .notification.show {
        transform: translateX(0);
    }

    .api-status-grid {
        grid-template-columns: 1fr;
    }

    .analysis-meta {
        text-align: center;
    }

    .footer-section .col-20 {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
    }

    .footer-section ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-section .footer-logo {
        margin: 0 auto 15px;
    }

    .footer-bottom .row {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom .col-md-6 {
        margin-bottom: 10px;
    }

    .progress-tracker {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .progress-tracker::before {
        display: none;
    }
    
    .progress-step {
        flex: 0 0 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }
}

@media (max-width: 991px) {
    .footer-section .col-20 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 1024px) {
    .main-content .container {
        max-width: 100%;
    }

    .main-content .row {
        flex-direction: column;
    }

    .form-panel {
        position: static;
    }
}