/* Matrimon — application styles (local, no external fonts) */
:root {
    --brand: #8a3b4c;
    --brand-dark: #6d2c3a;
    --brand-soft: #f7efe9;
    --accent: #c9866b;
    --ink: #261f1c;
    --muted: #6f6560;
    --line: #e7ded8;
    --surface: #ffffff;
    --surface-alt: #fbf7f3;
    --success: #2f6f4f;
    --radius: 1rem;
    --shadow-sm: 0 .25rem .75rem rgba(38, 31, 28, .06);
    --shadow-md: 0 .75rem 2rem rgba(38, 31, 28, .10);
}

html { scroll-behavior: smooth; }
body.app-body, body.admin-body {
    background: var(--surface-alt);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--brand); text-decoration-thickness: .06em; text-underline-offset: .15em; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4, h5, h6, .brand-name { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 3000;
    background: #fff; color: var(--ink); padding: .75rem 1rem; border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; }

/* Buttons */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-outline-brand:hover, .btn-outline-brand:focus { background: var(--brand); color: #fff; }
.btn-icon { background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 50%; width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--brand-soft); color: var(--brand); }
.btn-user { background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 2rem; }
.btn-user:hover { background: var(--brand-soft); }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .nav-link:focus-visible, .page-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; box-shadow: none; }
.btn { --bs-btn-border-radius: .65rem; }

/* Header and navigation */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030; box-shadow: 0 1px 0 rgba(38,31,28,.02); }
.site-header .navbar { padding-top: .7rem; padding-bottom: .7rem; }
.brand-mark {
    width: 2.4rem; height: 2.4rem; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
}
.brand-mark-sm { width: 2rem; height: 2rem; font-size: .9rem; }
.brand-name { display: block; font-weight: 700; font-size: 1.25rem; line-height: 1.05; color: var(--ink); }
.brand-tagline { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.brand-logo { max-width: 180px; height: auto; }
.site-header .nav-link { color: var(--ink); font-weight: 500; padding: .55rem .75rem !important; border-radius: .5rem; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--brand); background: var(--brand-soft); }
.verify-strip { background: #fff3cd; border-top: 1px solid #f0d78e; color: #5c4600; padding: .5rem 0; font-size: .9rem; }
.notification-dot { position: absolute; top: .45rem; right: .5rem; width: .55rem; height: .55rem; border-radius: 50%; background: #c0392b; border: 2px solid #fff; }
.dropdown-header { font-family: inherit; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.dropdown-item:active { background: var(--brand); }

.site-main { flex: 1 0 auto; padding-bottom: 3rem; }
.flash-stack { margin-bottom: 1rem; }
.flash-stack .alert { border-radius: .75rem; box-shadow: var(--shadow-sm); }

/* Footer */
.site-footer { background: #2b2320; color: #efe8e3; margin-top: auto; padding: 3rem 0 1.5rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-brand .brand-name { color: #fff; }
.footer-tagline { color: #c9beb7; max-width: 26rem; }
.footer-heading { font-family: inherit; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #bfb1a8; margin-bottom: .9rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links-inline { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.footer-links-inline li { margin: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1rem; font-size: .82rem; color: #b9ada5; }

/* Cards, sections, typography helpers */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-footer { border-top: 1px solid var(--line); }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.surface-soft { background: var(--brand-soft); border-radius: var(--radius); }
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 700; color: var(--brand); }
.text-muted { color: var(--muted) !important; }
.min-w-0 { min-width: 0; }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2rem; font-size: 1.5rem; }
.prose h3 { margin-top: 1.5rem; font-size: 1.15rem; }
.prose p, .prose li { line-height: 1.7; }
.divider-heart { display: flex; align-items: center; gap: .75rem; color: var(--accent); }
.divider-heart::before, .divider-heart::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(120deg, var(--brand-soft) 0%, #fff 55%, #fdf6f1 100%); border-bottom: 1px solid var(--line); }
.hero::after {
    content: ""; position: absolute; width: 28rem; height: 28rem; border-radius: 50%;
    background: radial-gradient(circle at center, rgba(201,134,107,.24), transparent 65%);
    right: -6rem; top: -8rem; pointer-events: none;
}
.hero-title { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.08; }
.hero-lede { font-size: 1.1rem; color: #544944; max-width: 38rem; line-height: 1.7; }
.hero-card { background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border: 1px solid rgba(138,59,76,.15); border-radius: 1.25rem; box-shadow: var(--shadow-md); }
.trust-item { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: #4b403b; }
.trust-item i { color: var(--brand); font-size: 1.1rem; }

/* Stats and features */
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; height: 100%; }
.stat-tile .stat-value { font-size: 1.65rem; font-weight: 700; font-family: Georgia, serif; line-height: 1.1; }
.stat-tile .stat-label { color: var(--muted); font-size: .82rem; }
.stat-icon { width: 2.4rem; height: 2.4rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.feature-icon { width: 3rem; height: 3rem; border-radius: .9rem; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.step-number { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex: 0 0 auto; }
.avatar-sm { width: 2rem; height: 2rem; font-size: .72rem; }
.avatar-md { width: 3rem; height: 3rem; font-size: .95rem; }
.avatar-lg { width: 5rem; height: 5rem; font-size: 1.4rem; }
.avatar-xl { width: 100%; height: 100%; border-radius: var(--radius); font-size: 3rem; }
.candidate-card { overflow: hidden; }
.candidate-photo { position: relative; aspect-ratio: 4 / 4.3; background: var(--brand-soft); }
.candidate-photo .avatar { border-radius: 0; }
.candidate-score { position: absolute; left: .6rem; bottom: .6rem; background: rgba(38,31,28,.82); color: #fff; font-size: .75rem; padding: .25rem .55rem; border-radius: 2rem; }
.online-dot { position: absolute; right: .7rem; top: .7rem; width: .8rem; height: .8rem; border-radius: 50%; background: #2e9e5b; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(46,158,91,.18); }
.candidate-card .card-body { padding: .9rem 1rem; }
.candidate-card .card-footer { padding: .6rem .8rem .8rem; border-top: 0; }
.compat-ring {
    width: 4.6rem; height: 4.6rem; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 4px solid currentColor; background: #fff; line-height: 1;
}
.compat-ring strong { font-size: 1.05rem; }
.compat-ring small { font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; }

/* Profile */
.profile-hero { background: linear-gradient(120deg, var(--brand-soft), #fff); border: 1px solid var(--line); border-radius: var(--radius); }
.profile-photo-large { width: 100%; aspect-ratio: 1 / 1.1; border-radius: .9rem; overflow: hidden; background: var(--brand-soft); }
.profile-photo-large img { width: 100%; height: 100%; object-fit: cover; }
.detail-list { margin: 0; }
.detail-list dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-top: .9rem; }
.detail-list dd { margin: .15rem 0 0; }
.progress-thin { height: .5rem; border-radius: 1rem; }
.progress-step { display: flex; gap: .5rem; align-items: center; font-size: .85rem; }
.progress-step .dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: .65rem; }
.progress-step.done .dot { background: var(--success); border-color: var(--success); color: #fff; }

/* Forms */
.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.form-control, .form-select { border-color: #dcd0c8; border-radius: .6rem; padding: .6rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(138,59,76,.12); }
.form-text { color: var(--muted); }
.required::after { content: " *"; color: #b03a2e; }
.auth-card { max-width: 30rem; margin-inline: auto; }
.auth-wrap { max-width: 44rem; margin-inline: auto; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 3rem; }
.password-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: .4rem .6rem; border-radius: .5rem; }
.password-toggle:hover { color: var(--brand); background: var(--brand-soft); }
.form-check-label { font-size: .92rem; }
fieldset { border-radius: .75rem; }
legend { font-weight: 700; }

/* Tables */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .75rem; vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-alt); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: var(--brand-soft); }
.table-responsive { border-radius: .75rem; }

/* Badges and alerts */
.badge { font-weight: 600; letter-spacing: .01em; }
.text-bg-success { background-color: #2f6f4f !important; }
.text-bg-warning { background-color: #ffe08a !important; color: #5d4500 !important; }
.text-bg-danger { background-color: #a33a32 !important; }
.text-bg-info { background-color: #cfe5ea !important; color: #1f4a55 !important; }
.text-bg-light { background-color: #f1e9e3 !important; color: #4b403b !important; border: 1px solid var(--line); }
.alert { border: 1px solid transparent; }

/* Empty states */
.empty-state { background: #fff; border: 1px dashed #d8c9c0; border-radius: var(--radius); padding: 2.5rem 1.5rem; }
.empty-icon { width: 4rem; height: 4rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }

/* Chat / messages */
.chat-layout { min-height: 32rem; }
.chat-list { max-height: 34rem; overflow-y: auto; }
.chat-list .list-group-item { border-left: 0; border-right: 0; }
.chat-list .list-group-item.active { background: var(--brand-soft); color: var(--ink); border-color: var(--line); }
.chat-thread { display: flex; flex-direction: column; gap: .6rem; min-height: 18rem; max-height: 30rem; overflow-y: auto; padding: 1rem; background: var(--surface-alt); border-radius: .75rem; }
.chat-bubble { max-width: 78%; padding: .65rem .85rem; border-radius: .9rem; background: #fff; border: 1px solid var(--line); overflow-wrap: anywhere; }
.chat-bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-color: var(--brand); }
.chat-bubble .chat-meta { font-size: .68rem; opacity: .75; margin-top: .25rem; }
.chat-composer { border-top: 1px solid var(--line); padding-top: .8rem; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: .55rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-left: 2rem; padding-bottom: 1rem; }
.timeline li::before { content: ""; position: absolute; left: .25rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--line); }

/* Gallery */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.photo-tile { position: relative; border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; background: #fff; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-tile .photo-meta { padding: .5rem .65rem; font-size: .78rem; }
.photo-tile .photo-actions { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 .65rem .65rem; }

/* Plan cards */
.plan-card { height: 100%; border-radius: 1.1rem; }
.plan-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-md); }
.plan-price { font-size: 2.2rem; font-weight: 700; font-family: Georgia, serif; }
.plan-price small { font-size: .85rem; color: var(--muted); font-weight: 400; }
.plan-features { list-style: none; padding: 0; margin: 1rem 0 0; }
.plan-features li { padding: .35rem 0; font-size: .9rem; display: flex; gap: .5rem; }
.plan-features i { color: var(--success); }

/* Story */
.story-card { height: 100%; }
.story-quote { font-family: Georgia, serif; font-size: 1.05rem; line-height: 1.65; }
.story-body { font-size: 1.05rem; line-height: 1.8; white-space: pre-line; }

/* Stepper/auth */
.auth-side { background: linear-gradient(140deg, var(--brand), #5c2531); color: #fff; border-radius: var(--radius); padding: 2rem; height: 100%; }
.auth-side a { color: #fff; }
.auth-side .trust-item { color: #f4e7e3; }
.auth-side .trust-item i { color: #ffd7c7; }
.auth-tabs .nav-link { color: var(--ink); border-radius: .6rem; }
.auth-tabs .nav-link.active { background: var(--brand-soft); color: var(--brand); }

/* Pagination */
.pagination { margin: 0; }
.page-link { color: var(--brand); border-color: var(--line); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.page-link:hover { color: var(--brand-dark); background: var(--brand-soft); }

/* Search */
.filter-panel { position: sticky; top: 6rem; }
.filter-panel .card-body { max-height: calc(100vh - 9rem); overflow-y: auto; }
.saved-search { border: 1px solid var(--line); border-radius: .7rem; padding: .6rem .75rem; background: #fff; }
.saved-search + .saved-search { margin-top: .5rem; }

/* Notification list */
.notification-item { border-left: 3px solid transparent; }
.notification-item.unread { border-left-color: var(--brand); background: #fffaf6; }

/* Footer on auth pages */
.auth-page { padding: 2.5rem 0; }

/* Admin shell */
.admin-body { background: #f2efec; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 16.5rem; flex: 0 0 16.5rem;
    background: #2b2320; color: #ece4df;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    z-index: 1040;
}
.admin-brand { display: flex; align-items: center; gap: .5rem; padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-brand .brand-name { color: #fff; font-size: 1.05rem; }
.admin-brand-sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #bfb1a8; }
.admin-nav { padding: .75rem .6rem; flex: 1 0 auto; }
.admin-nav-heading { color: #a99b92; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; margin: 1rem .6rem .35rem; }
.admin-nav .nav-link { color: #e5dcd6; border-radius: .6rem; padding: .55rem .65rem; display: flex; align-items: center; gap: .6rem; font-size: .92rem; }
.admin-nav .nav-link i { width: 1.2rem; text-align: center; opacity: .85; }
.admin-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav .nav-link.active { background: var(--brand); color: #fff; }
.admin-sidebar-footer { padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; }
.admin-sidebar-footer a { color: #d9cbc4; }
.admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.25rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1020; }
.admin-page-title { font-size: 1.15rem; margin: 0; font-family: inherit; font-weight: 700; }
.admin-page-subtitle { margin: 0; color: var(--muted); font-size: .8rem; }
.admin-content { padding: 1.25rem; }
.admin-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
.admin-metric { background: #fff; border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; height: 100%; }
.admin-metric .metric-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.admin-metric .metric-value { font-size: 1.6rem; font-weight: 700; font-family: Georgia, serif; line-height: 1.1; }
.admin-metric .metric-hint { font-size: .75rem; color: var(--muted); }
.chart-bars { display: flex; align-items: flex-end; gap: .3rem; height: 8rem; padding-top: .5rem; }
.chart-bar { flex: 1; min-width: 2px; background: color-mix(in srgb, var(--brand) 70%, white); border-radius: .25rem .25rem 0 0; position: relative; }
.chart-bar span { position: absolute; bottom: -1.35rem; left: 50%; transform: translateX(-50%); font-size: .58rem; color: var(--muted); white-space: nowrap; }
.admin-filter { background: #fff; border: 1px solid var(--line); border-radius: .8rem; padding: .85rem 1rem; }

/* Responsive */
@media (max-width: 991.98px) {
    .admin-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
    .admin-sidebar.is-open { transform: translateX(0); }
    .filter-panel { position: static; }
}
@media (max-width: 575.98px) {
    .section { padding: 2.5rem 0; }
    .hero-title { font-size: 2rem; }
    .stat-tile .stat-value { font-size: 1.35rem; }
    .admin-content { padding: .75rem; }
    .chat-thread { max-height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
    .site-header, .site-footer, .admin-sidebar, .admin-topbar, .btn, .flash-stack { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; }
}
