/* ===== Global Reset & Base ===== */
html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    color: #1a1a2e;
}

a { color: #16a34a; }
a:hover { color: #15803d; }

.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(22, 163, 74, 0.25);
}

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #dc2626; font-size: 0.85rem; margin-top: 0.25rem; }

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #065f46 0%, #16a34a 50%, #4ade80 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    margin-bottom: 1rem;
    display: inline-block;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.login-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.login-card .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.login-card .form-control-lg {
    border-radius: 10px;
    border: 1.5px solid #d1d5db;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card .form-control-lg:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.btn-login {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
    color: white;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.85rem;
}

.login-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 160px); /* Adjust based on header/footer height */
    padding: 2rem;
}

/* ===== App Layout ===== */
.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: #ffffff;
    /*color: white;*/
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #16a34a;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    display: block;
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.8rem;
    opacity: 0.85;
}

.header-info {
    font-size: 0.8rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-divider {
    opacity: 0.5;
}

.btn-header-signout {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.btn-header-signout:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

.app-body {
    flex: 1;
    display: flex;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}



.brand-icon img {
    object-fit: contain;
    border-radius: 6px;
}

.brand-text {
    border-left: 1px solid black;
    padding-left: 15px;
}

/* ===== Sidebar ===== */
.app-sidebar {
    width: 260px;
    min-width: 260px;
    background: white;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: flex-start;
    position: sticky;
    top: 68px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
}

.sidebar-section {
    padding: 0 1rem;
}

.sidebar-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin: 0 0 0.75rem;
    padding: 0 0.75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    line-height: 1.35;
}

.sidebar-link:hover {
    background: #f0fdf4;
    color: #16a34a;
    text-decoration: none;
}

.sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar-link:hover svg {
    opacity: 1;
    stroke: #16a34a;
}

.sidebar-link-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.sidebar-link-danger:hover svg {
    stroke: #dc2626;
}

.sidebar-link-external {
    color: #16a34a;
    font-weight: 600;
}

.sidebar-note {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
}

.sidebar-note strong {
    color: #374151;
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 2rem;
}

.app-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== Dashboard ===== */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.welcome-banner {
    background: linear-gradient(135deg, #065f46, #16a34a);
    color: white;
    border-radius: 14px;
    padding: 1.75rem 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.welcome-banner h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.welcome-banner p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
    line-height: 1.5;
}

.enrollment-alert {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 2px;
}

/* ===== Coverage Cards Grid ===== */
.coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.coverage-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.coverage-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.card-header-bar {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: white;
}

.card-header-bar h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-header-bar.medical { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.card-header-bar.dental { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.card-header-bar.vision { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.card-header-bar.life { background: linear-gradient(135deg, #dc2626, #f87171); }

.card-body-content {
    padding: 1rem 1.25rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    text-align: right;
}

.detail-value.mono {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    letter-spacing: 0.03em;
}

.badge {
    padding: 0.3em 0.75em;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.bg-blue { background: #dbeafe; color: #1d4ed8; }
.bg-teal { background: #ccfbf1; color: #0d9488; }
.bg-purple { background: #ede9fe; color: #7c3aed; }

/* ===== Account Section ===== */
.account-section {
    display: flex;
}

.account-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    width: 100%;
}

.account-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #1f2937;
}

.billing-grid {
    display: flex;
    gap: 2rem;
}

.billing-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.billing-label {
    font-size: 0.85rem;
    color: #6b7280;
}

.billing-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #16a34a;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    border-radius: 8px;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d, #166534);
}

.btn-outline-success {
    border: 2px solid #16a34a;
    color: #16a34a;
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline-success:hover {
    background: #16a34a;
    color: white;
}

/* ===== Info Section ===== */
.info-section .info-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.info-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #1f2937;
}

.info-card ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ===== Contact Grid ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.contact-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.contact-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.75rem;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.link-list li {
    padding: 0.4rem 0;
}

.link-list a {
    color: #16a34a;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.link-list a:hover {
    text-decoration: underline;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-group {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.contact-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
}

.contact-label {
    font-size: 0.85rem;
    color: #6b7280;
}

.contact-phone {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}

/* ===== Blazor Error UI ===== */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    background: #b32121;
    color: white;
    padding: 0.75rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    text-align: center;
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .app-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        text-align: center;
    }

    .header-info {
        justify-content: center;
    }

    .app-main {
        padding: 1rem;
    }

    .welcome-banner {
        flex-direction: column;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .billing-grid {
        flex-direction: column;
        gap: 1rem;
    }
}
