/*
 * Hiilgey.mn — хэрэглэгчийн сайтын үндсэн загвар (Bootstrap 5.3 дээр).
 * Өнгө, зай, радиусыг энд CSS хувьсагчаар тодорхойлно. Модулиуд шинэ өнгө оруулахгүй, эдгээрийг ашиглана.
 * Модулийн тусгай загварыг component-ийн .razor.css (scoped CSS)-д бичнэ.
 */

:root {
    --fp-primary: #0f766e;
    --fp-primary-600: #0d6560;
    --fp-primary-50: #ecfdf8;
    --fp-primary-100: #ccf3ea;
    --fp-accent: #f59e0b;
    --fp-accent-600: #d97706;
    --fp-ink: #0f172a;
    --fp-muted: #64748b;
    --fp-border: #e2e8f0;
    --fp-surface: #ffffff;
    --fp-surface-muted: #f8fafc;
    --fp-radius: 0.75rem;
    --fp-radius-lg: 1.25rem;
    --fp-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
    --fp-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --fp-header-height: 64px;
    --fp-tabbar-height: 64px;

    --bs-primary: var(--fp-primary);
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: var(--fp-primary);
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: var(--fp-primary-600);
    --bs-link-hover-color-rgb: 13, 101, 96;
    --bs-body-color: var(--fp-ink);
    --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-border-color: var(--fp-border);
    --bs-border-radius: 0.5rem;
    --bs-border-radius-lg: var(--fp-radius);
    --bs-focus-ring-color: rgba(15, 118, 110, 0.25);
}

html {
    scroll-padding-top: calc(var(--fp-header-height) + 1rem);
}

body {
    background: var(--fp-surface);
    color: var(--fp-ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .page-title {
    letter-spacing: -0.01em;
    color: var(--fp-ink);
}

.page-title {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.container-narrow {
    max-width: 760px;
}

.min-w-0 {
    min-width: 0;
}

.icon {
    flex-shrink: 0;
    vertical-align: -0.2em;
}

/* --- Bootstrap товчлуурууд --- */
.btn {
    font-weight: 600;
    border-radius: 0.6rem;
}

.btn-primary {
    --bs-btn-bg: var(--fp-primary);
    --bs-btn-border-color: var(--fp-primary);
    --bs-btn-hover-bg: var(--fp-primary-600);
    --bs-btn-hover-border-color: var(--fp-primary-600);
    --bs-btn-active-bg: var(--fp-primary-600);
    --bs-btn-active-border-color: var(--fp-primary-600);
    --bs-btn-disabled-bg: var(--fp-primary);
    --bs-btn-disabled-border-color: var(--fp-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--fp-primary);
    --bs-btn-border-color: var(--fp-primary);
    --bs-btn-hover-bg: var(--fp-primary);
    --bs-btn-hover-border-color: var(--fp-primary);
    --bs-btn-active-bg: var(--fp-primary-600);
    --bs-btn-active-border-color: var(--fp-primary-600);
}

.btn-accent {
    --bs-btn-color: #1f1300;
    --bs-btn-bg: var(--fp-accent);
    --bs-btn-border-color: var(--fp-accent);
    --bs-btn-hover-color: #1f1300;
    --bs-btn-hover-bg: var(--fp-accent-600);
    --bs-btn-hover-border-color: var(--fp-accent-600);
    --bs-btn-active-color: #1f1300;
    --bs-btn-active-bg: var(--fp-accent-600);
    --bs-btn-active-border-color: var(--fp-accent-600);
    --bs-btn-focus-shadow-rgb: 245, 158, 11;
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--fp-primary);
    box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}

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

.form-label {
    font-weight: 600;
    font-size: 0.925rem;
}

/* --- Хүртээмж --- */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 2000;
    padding: 0.5rem 1rem;
    background: var(--fp-ink);
    color: #fff;
    border-radius: 0.5rem;
}

.skip-link:focus {
    top: 0.5rem;
}

:focus-visible {
    outline: 2px solid var(--fp-primary);
    outline-offset: 2px;
}

/* FocusOnNavigate гарчиг руу focus шилжүүлдэг (дэлгэц уншигчид зориулсан) — харагдах хүрээ хэрэггүй. */
h1:focus,
h1:focus-visible {
    outline: none;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--fp-header-height);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--fp-border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--fp-ink);
}

.brand-mark {
    display: inline-flex;
    color: var(--fp-primary);
}

.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.primary-nav {
    gap: 0.25rem;
    margin-left: 1rem;
}

.nav-item-link {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--fp-muted);
    font-weight: 500;
    text-decoration: none;
}

.nav-item-link:hover {
    color: var(--fp-ink);
    background: var(--fp-surface-muted);
}

.nav-item-link.active {
    color: var(--fp-primary);
    background: var(--fp-primary-50);
}

.icon-button {
    position: relative;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--fp-muted);
    text-decoration: none;
}

.icon-button:hover {
    background: var(--fp-surface-muted);
    color: var(--fp-ink);
}

/* Layout slot-ын тоолуур (LayoutSlots.ChatBadge, NotificationsBadge): <span class="nav-badge">3</span> */
.nav-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--fp-danger, #dc2626);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

.mobile-tabbar a .nav-badge {
    top: 4px;
    right: calc(50% - 22px);
}

.avatar-button {
    border: 0;
    padding: 0;
    background: none;
    border-radius: 50%;
}

.avatar {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--fp-primary-100);
    color: var(--fp-primary-600);
    font-weight: 700;
}

.dropdown-menu {
    border-radius: var(--fp-radius);
    border-color: var(--fp-border);
    padding: 0.5rem;
    min-width: 230px;
}

.dropdown-item {
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:active {
    background: var(--fp-primary);
}

.dropdown-header {
    font-weight: 700;
    color: var(--fp-ink);
}

/* --- Үндсэн хэсэг, footer --- */
.site-main {
    flex: 1 0 auto;
}

.site-footer {
    margin-top: 3rem;
    padding: 2.5rem 0 1.5rem;
    background: var(--fp-surface-muted);
    border-top: 1px solid var(--fp-border);
}

.site-footer a {
    color: var(--fp-muted);
    text-decoration: none;
    line-height: 2;
}

.site-footer a:hover {
    color: var(--fp-primary);
}

.site-footer .brand {
    color: var(--fp-ink);
}

.footer-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fp-ink);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* --- Гар утасны доод цэс --- */
.mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: calc(var(--fp-tabbar-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: #fff;
    border-top: 1px solid var(--fp-border);
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.05);
}

.mobile-tabbar a {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.7rem;
    color: var(--fp-muted);
    text-decoration: none;
}

.mobile-tabbar a.active {
    color: var(--fp-primary);
}

.mobile-tabbar a.tab-cta {
    color: var(--fp-primary);
    font-weight: 600;
}

.mobile-tabbar a.tab-cta .icon {
    color: #fff;
    background: var(--fp-primary);
    border-radius: 50%;
    padding: 4px;
    box-sizing: content-box;
    margin-top: -14px;
    box-shadow: var(--fp-shadow);
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(var(--fp-tabbar-height) + env(safe-area-inset-bottom));
    }

    .site-footer {
        margin-top: 2rem;
    }
}

/* --- Нүүр хуудас --- */
.hero {
    padding: clamp(2rem, 4vw, 4.5rem) 0;
    background:
        radial-gradient(1200px 400px at 85% -10%, rgba(245, 158, 11, 0.12), transparent 60%),
        linear-gradient(180deg, var(--fp-primary-50), #fff);
}

.hero-title {
    font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.1rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--fp-muted);
    max-width: 38rem;
    margin-bottom: 1.5rem;
}

.hero-search {
    position: relative;
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid var(--fp-border);
    border-radius: 1rem;
    box-shadow: var(--fp-shadow);
    max-width: 40rem;
}

.hero-search .form-control {
    border: 0;
    padding-left: 2.75rem;
    box-shadow: none;
}

.hero-search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fp-muted);
    pointer-events: none;
}

@media (max-width: 575.98px) {
    .hero-search .btn {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.trust-list {
    list-style: none;
    padding: 1.5rem;
    margin: 0;
    display: grid;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-lg);
    box-shadow: var(--fp-shadow);
}

.trust-list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-weight: 500;
}

.trust-list .icon {
    color: var(--fp-primary);
}

.section {
    padding-top: clamp(2rem, 4vw, 3.5rem);
    padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-muted {
    background: var(--fp-surface-muted);
}

.section-title {
    font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius);
    background: #fff;
    color: var(--fp-ink);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.category-card:hover {
    border-color: var(--fp-primary);
    box-shadow: var(--fp-shadow);
    transform: translateY(-2px);
    color: var(--fp-ink);
}

.category-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--fp-primary-50);
    color: var(--fp-primary);
}

.category-name {
    font-weight: 600;
    line-height: 1.3;
}

.category-meta {
    font-size: 0.8rem;
    color: var(--fp-muted);
}

.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.steps li {
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius);
}

.steps h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0.75rem 0 0.35rem;
}

.steps p {
    color: var(--fp-muted);
    margin: 0;
    font-size: 0.95rem;
}

.step-number {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--fp-primary);
    color: #fff;
    font-weight: 700;
}

.pro-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: var(--fp-radius-lg);
    background: linear-gradient(120deg, var(--fp-primary), #115e59);
    color: #fff;
}

.pro-cta h2 {
    color: #fff;
}

.pro-cta p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 36rem;
}

/* --- Бүртгэл / нэвтрэлт --- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--fp-primary-50), var(--fp-surface-muted) 40%);
}

.auth-header {
    padding: 1.25rem 1.5rem;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 1rem 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    background: #fff;
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-lg);
    box-shadow: var(--fp-shadow);
}

@media (min-width: 576px) {
    .auth-main {
        padding-top: 3vh;
    }
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.auth-subtitle {
    color: var(--fp-muted);
    margin-bottom: 1.5rem;
}

.auth-switch {
    text-align: center;
    margin: 1.5rem 0 0;
    color: var(--fp-muted);
}

.auth-footer {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--fp-muted);
}

.auth-footer a {
    color: var(--fp-muted);
}

.stepper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.stepper-dot {
    width: 28px;
    height: 6px;
    border-radius: 3px;
    background: var(--fp-border);
}

.stepper-dot.active {
    background: var(--fp-primary);
}

.stepper-text {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--fp-muted);
}

.otp-input {
    font-size: 1.6rem;
    letter-spacing: 0.6em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* --- Төхөөрөмжүүд --- */
.session-list {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.session-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius);
    background: #fff;
}

.session-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--fp-surface-muted);
    color: var(--fp-muted);
    flex-shrink: 0;
}

/* --- Нийтлэг --- */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--fp-muted);
    border: 1px dashed var(--fp-border);
    border-radius: var(--fp-radius);
}

.money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.error-page {
    max-width: 560px;
    margin: 4rem auto;
    text-align: center;
}

.error-code {
    font-size: 4rem;
    font-weight: 800;
    color: var(--fp-primary);
    line-height: 1;
}

/* Blazor validation */
.valid.modified:not([type=checkbox]) {
    outline: none;
}

.invalid {
    border-color: var(--bs-danger) !important;
}

.validation-message {
    color: var(--bs-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fffbeb;
    border-top: 1px solid var(--fp-accent);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem 0.85rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#blazor-error-ui .reload {
    margin-left: 0.5rem;
}
