/* ════════════════════════════════════════════════════════════════
   TenderAI Design System
   ════════════════════════════════════════════════════════════════ */

:root {
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --cyan: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #6b7280;
    --gray-900: #111827;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
}

html, body {
    font-family: 'Segoe UI', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
}

a, .btn-link {
    color: var(--accent);
}

/* ─── Buttons ─── */
.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    border-radius: 8px;
    font-weight: 500;
}
.btn-primary:hover, .btn-primary:active {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}
.btn-lg { border-radius: 10px; }
.btn-outline-primary { border-radius: 8px; }
.btn-outline-secondary { border-radius: 8px; }
.btn-outline-danger { border-radius: 8px; }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.25);
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--gray-200);
}
.form-control-lg { border-radius: 10px; }

/* ─── Cards ─── */
.card {
    border-radius: var(--radius);
    transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ─── Validation ─── */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--green); }
.invalid { outline: 1px solid var(--red); }
.validation-message { color: var(--red); font-size: .85rem; }
h1:focus { outline: none; }

/* ────────────────────────────────────────────────────────────────
   PUBLIC LAYOUT (Home, Login, Register)
   ──────────────────────────────────────────────────────────────── */

.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
}

/* ─── Top Navbar ─── */
.public-navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: .75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,.92);
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
}
.brand-icon-lg {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    border-radius: 12px;
}

/* ─── Hero Section ─── */
.hero {
    background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 40%, #faf5ff 100%);
    padding: 4rem 0 5rem;
}
.min-vh-65 { min-height: 65vh; }

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
.text-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--gray-600);
    line-height: 1.7;
    max-width: 480px;
}

/* Hero Visual (mock cards) */
.hero-visual {
    position: relative;
    height: 380px;
}
.hero-card {
    position: absolute;
    background: white;
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    border: 1px solid var(--gray-100);
}
.hero-card.card-1 { top: 0; right: 0; }
.hero-card.card-2 { top: 120px; right: 80px; }
.hero-card.card-3 { top: 240px; right: 20px; }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot-green { background: var(--green); }
.dot-blue { background: var(--accent); }
.dot-yellow { background: var(--yellow); }

.score-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    margin-bottom: 4px;
}
.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green) 0%, #16a34a 100%);
    border-radius: 4px;
}

/* ─── Features Section ─── */
.features-section {
    padding: 5rem 0;
    background: white;
}
.feature-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
    transition: all .2s;
}
.feature-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.feature-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.feature-icon-box.bg-success-subtle { color: var(--green); }
.feature-icon-box.bg-warning-subtle { color: #b45309; }
.feature-icon-box.bg-info-subtle { color: var(--cyan); }

/* ─── Stats Section ─── */
.stats-section {
    padding: 3rem 0;
    background: var(--gray-900);
    color: white;
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: .9rem;
    color: rgba(255,255,255,.6);
    margin-top: .25rem;
}

/* ─── How It Works ─── */
.how-section {
    padding: 5rem 0;
    background: white;
}
.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
}
.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ─── Download Section ─── */
.download-section {
    padding: 4rem 0;
    background: var(--gray-50);
}
.download-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid var(--gray-200);
}

/* ─── Footer ─── */
.public-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

/* ════════════════════════════════════════════════════════════════
   PUBLIC CONTENT PAGES
   ════════════════════════════════════════════════════════════════ */

/* ─── Page Hero ─── */
.public-hero {
    background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 40%, #faf5ff 100%);
    padding: 4rem 0 3rem;
    text-align: center;
}
.public-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--gray-900);
}
.public-hero .lead {
    font-size: 1.15rem;
    color: var(--gray-600);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ─── Content Sections ─── */
.content-section { padding: 4rem 0; }
.content-section-alt { padding: 4rem 0; background: var(--gray-50); }
.content-section-dark { padding: 4rem 0; background: var(--gray-900); color: white; }
.section-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-subtitle { color: var(--gray-600); max-width: 600px; margin: 0 auto 2rem; }

/* ─── Content Feature Cards ─── */
.content-feature-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
    transition: all .2s;
}
.content-feature-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* ─── Process Steps ─── */
.process-step { text-align: center; padding: 1.5rem; }
.process-step-number {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--accent-light); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem;
}

/* ─── CTA Section ─── */
.public-cta {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
    color: white;
    text-align: center;
}
.public-cta h2 { font-weight: 700; margin-bottom: 0.5rem; }
.public-cta p { opacity: 0.9; max-width: 500px; margin: 0 auto 1.5rem; }

/* ─── Pricing Cards ─── */
.pricing-card {
    background: white; border: 2px solid var(--gray-200);
    border-radius: var(--radius); padding: 2rem;
    text-align: center; height: 100%; transition: all .2s;
}
.pricing-card.popular {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: scale(1.03);
}
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--accent); }
.pricing-period { font-size: 0.9rem; color: var(--gray-600); }
.pricing-feature-list { list-style: none; padding: 0; text-align: left; }
.pricing-feature-list li {
    padding: .4rem 0; border-bottom: 1px solid var(--gray-100);
    font-size: .9rem; color: var(--gray-600);
}
.pricing-feature-list li::before { content: "\2713 "; color: var(--green); font-weight: 700; margin-right: .5rem; }
.pricing-limitation-list { list-style: none; padding: 0; text-align: left; }
.pricing-limitation-list li {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem 0; font-size: .85rem; color: var(--gray-500);
}
.pricing-limitation-list li svg { flex-shrink: 0; }

/* ─── FAQ Accordion ─── */
.faq-accordion .accordion-button:not(.collapsed) {
    background: var(--accent-light); color: var(--accent); box-shadow: none;
}
.faq-accordion .accordion-item {
    border-radius: var(--radius) !important;
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

/* ─── Trust Strip ─── */
.trust-strip {
    padding: 1.5rem 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

/* ─── Icon Box ─── */
.icon-box {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ─── Multi-Column Footer ─── */
.public-footer-full {
    padding: 3rem 0 1.5rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
    background: var(--gray-50);
}
.public-footer-full h6 {
    font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 600;
    color: var(--gray-900); margin-bottom: 1rem;
}
.public-footer-full ul { list-style: none; padding: 0; margin: 0; }
.public-footer-full ul li { margin-bottom: 0.5rem; }
.public-footer-full ul li a {
    color: var(--gray-600); text-decoration: none; font-size: 0.9rem;
}
.public-footer-full ul li a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--gray-200);
    padding-top: 1.5rem; margin-top: 2rem;
}

/* ─── Legal Pages ─── */
.legal-content h2 { font-size: 1.3rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; }
.legal-content p, .legal-content ul { color: var(--gray-600); line-height: 1.8; }

/* ─── Navbar Dropdowns ─── */
.public-navbar .dropdown-menu {
    border-radius: 10px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200); padding: 0.5rem; min-width: 200px;
}
.public-navbar .dropdown-item { border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.9rem; }
.public-navbar .dropdown-item:hover { background: var(--accent-light); color: var(--accent); }
.public-navbar .nav-link {
    font-weight: 500; font-size: 0.9rem;
    color: var(--gray-900) !important; padding: 0.5rem 0.75rem !important;
}
.public-navbar .nav-link:hover { color: var(--accent) !important; }

/* ─── Auth Pages ─── */
.auth-page {
    padding: 4rem 0;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f5ff 100%);
}
.auth-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

/* ────────────────────────────────────────────────────────────────
   AUTHENTICATED LAYOUT (Dashboard, Upload, etc.)
   ──────────────────────────────────────────────────────────────── */

.content {
    padding-top: 1.1rem;
    height: fit-content;
}

/* ─── Scrollable Tables with Sticky Headers ─── */
.table-responsive {
    max-height: 65vh;
    overflow-y: auto;
}
.table-responsive table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fa;
    box-shadow: 0 1px 0 var(--gray-200);
}
/* Let dropdowns render above the scroll container */
.table-responsive .dropdown-menu {
    position: fixed !important;
}

/* ─── Sidebar ─── */
.sidebar .top-row {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}
.sidebar .navbar-brand {
    font-size: 1.1rem;
}

/* ─── Score Ring ─── */
.score-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(
        var(--color, var(--accent)) calc(var(--score, 0) * 3.6deg),
        var(--gray-200) calc(var(--score, 0) * 3.6deg)
    );
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-inner {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}
.score-label {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ─── Upload Zone ─── */
.upload-zone {
    transition: all 0.2s;
    cursor: pointer;
    border-radius: var(--radius);
}
.upload-zone:hover {
    border-color: var(--accent) !important;
    background-color: var(--accent-light);
}
.border-dashed {
    border-style: dashed !important;
}

/* ─── Badges ─── */
.badge-green { background-color: var(--green); color: white; }
.badge-red { background-color: var(--red); color: white; }
.badge-yellow { background-color: var(--yellow); color: #1a1a1a; }

/* ─── Admin Section Indicator ─── */
.admin-header {
    background: linear-gradient(135deg, var(--accent-light) 0%, #faf5ff 100%);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
}

/* ─── Tables (admin) ─── */
.table th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-600);
    font-weight: 600;
    border-bottom-width: 2px;
}
.table td {
    vertical-align: middle;
}

/* ─── Stat Cards (Dashboard) ─── */
.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all .2s;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
    height: 100%;
}
.row > [class*="col-"] > .stat-card,
.row > [class*="col-"] > .card {
    height: 100%;
}
.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-info {
    min-width: 0;
}
.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-card-label {
    font-size: .8rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 500;
    word-wrap: break-word;
}
@media (max-width: 576px) {
    .stat-card {
        padding: .875rem;
        gap: .75rem;
    }
    .stat-card-icon {
        width: 40px;
        height: 40px;
    }
    .stat-card-value {
        font-size: 1.25rem;
    }
    .stat-card-label {
        font-size: .7rem;
        letter-spacing: .01em;
    }
}
@media (max-width: 480px) {
    .row > [class*="col-6"] {
        width: 100%;
        flex: 0 0 100%;
    }
}

/* ─── Utility ─── */
.cursor-pointer { cursor: pointer; }

/* ─── Analysis Page ─── */
.detail-item {
    padding: .5rem 0;
}
.detail-item + .detail-item {
    border-top: 1px solid var(--gray-100);
}
.detail-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: .15rem;
}
.detail-value {
    font-weight: 600;
    color: var(--gray-900);
}
.risk-card {
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    border-left: 4px solid;
    padding: 1rem 1.25rem;
    background: white;
    transition: all .15s;
}
.risk-card:hover {
    box-shadow: var(--shadow-sm);
}
.risk-card.risk-high { border-left-color: var(--red); }
.risk-card.risk-medium { border-left-color: var(--yellow); }
.risk-card.risk-low { border-left-color: var(--green); }

/* ─── Settings Page ─── */
.settings-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.settings-section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.settings-section-body {
    padding: 1.5rem;
}

/* ─── Upload Page ─── */
.upload-drop-area {
    display: block;
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all .2s;
    cursor: pointer;
    background: var(--gray-50);
}
.upload-drop-area:hover,
.upload-drop-area.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}
.upload-drop-area .upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 8px;
    padding: .5rem 1rem;
    font-weight: 500;
}

/* ────────────────────────────────────────────────────────────────
   FRAMEWORK / UTILITY
   ──────────────────────────────────────────────────────────────── */

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}
.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ────────────────────────────────────────────────────────────────
   RTL (Arabic) OVERRIDES
   ──────────────────────────────────────────────────────────────── */

[dir="rtl"] html, [dir="rtl"] body,
html[dir="rtl"], html[dir="rtl"] body {
    font-family: 'Noto Kufi Arabic', 'Segoe UI', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Admin header: border flips to right side in RTL */
[dir="rtl"] .admin-header {
    border-left: none;
    border-right: 4px solid var(--accent);
}

/* Risk card: left border flips to right */
[dir="rtl"] .risk-card {
    border-left: 1px solid var(--gray-200);
    border-right: 4px solid;
}
[dir="rtl"] .risk-card.risk-high { border-right-color: var(--red); }
[dir="rtl"] .risk-card.risk-medium { border-right-color: var(--yellow); }
[dir="rtl"] .risk-card.risk-low { border-right-color: var(--green); }

/* Hero visual cards: flip positioning */
[dir="rtl"] .hero-card.card-1 { right: auto; left: 0; }
[dir="rtl"] .hero-card.card-2 { right: auto; left: 80px; }
[dir="rtl"] .hero-card.card-3 { right: auto; left: 20px; }

/* Blazor error boundary: flip padding */
[dir="rtl"] .blazor-error-boundary {
    padding: 1rem 3.7rem 1rem 1rem;
    background-position: right 1rem center;
}

/* Sidebar nav alignment */
[dir="rtl"] .nav-item .nav-link {
    text-align: right;
}

/* Tables text alignment */
[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

/* Language switcher dropdown */
[dir="rtl"] .dropdown-menu-end {
    --bs-position: end;
}

/* Score bar fill gradient direction */
[dir="rtl"] .score-bar-fill {
    background: linear-gradient(270deg, var(--green) 0%, #16a34a 100%);
}

/* ────────────────────────────────────────────────────────────────
   FLOATING LANGUAGE SWITCHER (FAB)
   ──────────────────────────────────────────────────────────────── */

.lang-fab {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 1050;
}
[dir="rtl"] .lang-fab {
    left: auto;
    right: 1.25rem;
}

.lang-fab-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.lang-fab-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 99, 235, .45);
}
.lang-fab-btn:active {
    transform: scale(.97);
}
.lang-fab-btn svg {
    width: 22px;
    height: 22px;
}
.lang-fab-label {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: .55rem;
    font-weight: 700;
    background: white;
    color: var(--accent);
    border-radius: 6px;
    padding: 1px 4px;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.lang-fab-menu {
    min-width: 160px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: .35rem;
    margin-bottom: .5rem !important;
}
.lang-fab-menu .dropdown-item {
    border-radius: 6px;
    padding: .5rem .75rem;
    font-weight: 500;
}
.lang-fab-menu .dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}
.lang-fab-menu .dropdown-item.active {
    background: var(--accent);
    color: white;
}

/* ─── SweetAlert2 — ensure it renders above sidebar & navbar ─── */
.swal2-container {
    z-index: 99999 !important;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero { padding: 2.5rem 0 3rem; }
    .min-vh-65 { min-height: auto; }
    .stat-number { font-size: 1.6rem; }
    .auth-page { padding: 2rem 0; }
    .public-hero h1 { font-size: 1.75rem; }
    .public-hero { padding: 2.5rem 0 2rem; }
    .content-section, .content-section-alt { padding: 2.5rem 0; }
    .pricing-card.popular { transform: none; }
    .public-footer-full .row > div { margin-bottom: 1.5rem; }
}
