@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700;800&display=swap');

:root {
    --brand: #0d9488;          /* teal 600 */
    --brand-dark: #0f766e;
    --brand-050: #f0fdfa;
    --ink: #0f172a;            /* slate 900 */
    --muted: #64748b;          /* slate 500 */
    --line: #e2e8f0;
    --accent: #f59e0b;         /* amber 500 */
    --radius: 16px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--ink);
    background: #f8fafc;
}

h1, h2, h3, h4, .display-5 { font-family: 'Poppins', sans-serif; letter-spacing: -.01em; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1140px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-main { flex: 1; }

.nav-alerts { position: relative; }
.alerts-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px;
    font-size: .68rem; font-weight: 800; line-height: 1; vertical-align: middle;
    color: #fff; background: #dc2626; border-radius: 999px;
}

.testnet-banner {
    position: sticky; top: 0; z-index: 40;
    background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a;
    text-align: center; font-size: .84rem; font-weight: 600; line-height: 1.35;
    padding: 7px 14px; letter-spacing: .01em;
}
.testnet-banner strong { color: #b45309; }
.app-shell .testnet-banner + .app-header { top: 33px; }

.app-header {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.app-header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.35rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), #22c55e); color: #fff; font-family: 'Poppins'; font-weight: 800;
}
.brand-name { font-family: 'Poppins'; }
.brand-dot { color: var(--brand); }

.main-nav { display: flex; align-items: center; gap: .2rem; }

.nav-link {
    display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
    color: var(--ink); font-weight: 500; font-size: .93rem;
    padding: .45rem .7rem; border-radius: 999px; cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--brand-050); color: var(--brand-dark); text-decoration: none; }
.nav-link.active { background: var(--brand-050); color: var(--brand-dark); font-weight: 700; }
.nav-dd-menu a.active { background: var(--brand-050); color: var(--brand-dark); font-weight: 700; }

/* Primary CTA button in the nav */
.btn-nav-cta {
    display: inline-flex; align-items: center; white-space: nowrap; margin: 0 .15rem;
    background: var(--accent); color: #1a1206 !important; font-weight: 700; font-size: .92rem;
    padding: .5rem 1.05rem; border-radius: 999px; box-shadow: 0 4px 12px rgba(245, 158, 11, .35);
    transition: transform .1s ease, box-shadow .15s ease;
}
.btn-nav-cta:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245, 158, 11, .45); }

/* Hamburger (mobile only) */
.nav-toggle-cb { display: none; }
.hamburger { display: none; flex-direction: column; gap: 4px; padding: 8px; cursor: pointer; border-radius: 8px; }
.hamburger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav-toggle-cb:checked ~ .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle-cb:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
.nav-toggle-cb:checked ~ .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* No-JS dropdowns (Admin + user menu) via <details> */
.nav-dd { position: relative; }
.nav-dd > summary { list-style: none; }
.nav-dd > summary::-webkit-details-marker { display: none; }
.nav-dd > summary.nav-link::after { content: "▾"; font-size: .7rem; opacity: .55; margin-left: .1rem; }
.nav-dd[open] > summary.nav-link { background: var(--brand-050); color: var(--brand-dark); }
/* Highlight the Admin toggle when any page inside its menu is the active route */
.nav-dd:has(.nav-dd-menu .active) > summary.nav-link { background: var(--brand-050); color: var(--brand-dark); font-weight: 700; }
.nav-dd-menu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
    min-width: 190px; padding: .4rem; display: flex; flex-direction: column; gap: .1rem;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 16px 44px rgba(2, 6, 23, .16);
}
.nav-dd-right { left: auto; right: 0; }
.nav-dd-menu a, .nav-dd-signout {
    display: block; width: 100%; text-align: left; white-space: nowrap;
    padding: .5rem .7rem; border-radius: 9px; color: var(--ink); font-size: .92rem;
    background: transparent; border: none; cursor: pointer;
}
.nav-dd-menu a:hover, .nav-dd-signout:hover { background: var(--brand-050); color: var(--brand-dark); text-decoration: none; }
.nav-dd-signout { color: #dc2626; font-weight: 600; }
.nav-dd-signout:hover { background: #fef2f2; color: #b91c1c; }
.nav-dd-email {
    padding: .35rem .7rem .55rem; margin-bottom: .2rem; border-bottom: 1px solid var(--line);
    font-size: .8rem; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}

/* User avatar toggle */
.nav-avatar {
    list-style: none; cursor: pointer; user-select: none; margin-left: .4rem;
    width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: .95rem; font-family: 'Poppins';
    background: linear-gradient(135deg, var(--brand), #22c55e);
}
.nav-avatar::-webkit-details-marker { display: none; }
.nav-avatar:hover { filter: brightness(1.06); }

.btn-nav-solid {
    border-radius: 999px; padding: .5rem 1.15rem; font-weight: 700; font-size: .92rem; cursor: pointer;
    background: var(--brand); color: #fff !important; border: none; white-space: nowrap;
}
.btn-nav-solid:hover { background: var(--brand-dark); text-decoration: none; }

@media (max-width: 860px) {
    .hamburger { display: flex; }
    .main-nav {
        display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0; z-index: 45;
        flex-direction: column; align-items: stretch; gap: .15rem; padding: .6rem;
        background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 16px 40px rgba(2, 6, 23, .12);
    }
    .main-nav > * { width: 100%; }
    .nav-toggle-cb:checked ~ .main-nav { display: flex; }

    .main-nav .nav-link, .btn-nav-cta, .btn-nav-solid { justify-content: flex-start; }
    .btn-nav-cta, .btn-nav-solid { align-self: flex-start; }

    /* Dropdowns expand inline within the mobile panel */
    .nav-dd-menu { position: static; box-shadow: none; border: none; padding: 0 0 .3rem 1rem; min-width: 0; }
    .nav-user-dd { display: flex; align-items: center; gap: .6rem; }
    .nav-avatar { margin-left: 0; }
}

.app-footer {
    position: relative; border-top: 1px solid var(--line); background: #fff; color: var(--muted);
    padding: 1.6rem 0; margin-top: 3.5rem; font-size: .9rem;
}
.app-footer::before {
    content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--brand), #22c55e);
}
.app-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: .55rem; }
.footer-brand strong { color: var(--ink); }
.footer-mark { width: 26px; height: 26px; border-radius: 8px; font-size: .95rem; }
.footer-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); padding: .35rem .6rem; border-radius: 999px; transition: background .15s, color .15s; }
.footer-links a:hover { color: var(--brand-dark); background: var(--brand-050); text-decoration: none; }

/* ---------- Legal pages ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 1rem 0 2rem; }
.legal h1 { margin-bottom: .25rem; }
.legal h2 { font-size: 1.15rem; margin-top: 1.75rem; }
.legal ul { padding-left: 1.25rem; }
.legal li { margin-bottom: .4rem; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1000;
    display: none; align-items: center; justify-content: space-between; gap: 1rem;
    max-width: 1100px; margin: 0 auto; padding: .9rem 1.15rem;
    background: #0f172a; color: #e2e8f0; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.cookie-banner .cookie-text { font-size: .9rem; }
.cookie-banner a { color: #7dd3fc; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: 10px; font-weight: 600; padding: .5rem 1rem;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 8px; font-weight: 600; }
.btn-lg { border-radius: 12px; }
.btn:focus-visible { box-shadow: 0 0 0 .2rem rgba(13, 148, 136, .25); outline: none; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-success { background: #16a34a; border-color: #16a34a; }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-outline-primary { color: var(--brand-dark); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-outline-secondary { color: #475569; border-color: var(--line); }
.btn-outline-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; color: var(--ink); }
.btn-outline-danger { color: #dc2626; border-color: #fecaca; }
.btn-outline-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-outline-warning { color: #b45309; border-color: #fde68a; }
.btn-outline-warning:hover { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.btn-danger { background: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.card > .card-body { padding: 1.25rem 1.35rem; }
.card h5, .card h6 { font-family: 'Poppins', sans-serif; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: 10px; border-color: var(--line); padding: .55rem .8rem; color: var(--ink);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(13, 148, 136, .18);
}
.form-label { font-weight: 600; font-size: .9rem; color: #334155; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(13, 148, 136, .18); }

/* ---------- Tables ---------- */
.table thead th {
    border-bottom: 1px solid var(--line); color: var(--muted);
    font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
}
.table td, .table th { vertical-align: middle; }

/* ---------- Alerts / badges ---------- */
.alert { border-radius: 12px; border: 1px solid transparent; }
.badge { font-weight: 600; }
.badge.bg-secondary { background: #eef2f6 !important; color: #334155; }
.badge.bg-info { background: #e0f2fe !important; color: #075985 !important; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center; padding: 2.75rem 1.25rem; color: var(--muted);
    background: #fff; border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty-state .empty-emoji { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .85; }
.empty-state h5 { color: var(--ink); margin-bottom: .35rem; }
.empty-state .btn { margin-top: 1rem; }

/* ---------- Page header + stat cards ---------- */
.page-head { margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head .lead-sub { color: var(--muted); margin: 0; }

.stat { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); height: 100%; }
.stat .stat-label { color: var(--muted); font-size: .85rem; }
.stat .stat-value { font-family: 'Poppins', sans-serif; font-size: 1.65rem; font-weight: 700; line-height: 1.15; }
.stat-brand { background: linear-gradient(135deg, var(--brand-050), #fff); border-color: #cdeae6; }
.stat-amber { background: linear-gradient(135deg, #fffbeb, #fff); border-color: #fde68a; }
.stat-danger { background: linear-gradient(135deg, #fef2f2, #fff); border-color: #fecaca; }

.page-wrap { max-width: 1140px; margin: 0 auto; padding: 1.5rem 1rem 0; }

/* ---------- Hero ---------- */
.hero {
    position: relative; color: #fff; border-radius: 24px; overflow: hidden; margin: 1.5rem auto 0;
    max-width: 1140px;
}
.hero-bg {
    position: absolute; inset: 0;
    background:
      linear-gradient(120deg, rgba(13,148,136,.92), rgba(2,132,199,.78)),
      url('https://picsum.photos/seed/alaruhero/1600/700') center/cover;
}
.hero-inner { position: relative; padding: 4.5rem 2.5rem; max-width: 720px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; opacity: .96; margin-bottom: 1.75rem; }
.hero .btn { border-radius: 999px; padding: .8rem 1.6rem; font-weight: 700; }
.hero .hero-crypto { margin-top: 1.5rem; margin-bottom: 0; display: inline-block; font-size: 1rem; opacity: 1;
    color: #fff; background: rgba(2, 6, 23, .32); border: 1px solid rgba(255,255,255,.25);
    padding: .55rem 1rem; border-radius: 999px; }
.btn-amber { background: var(--accent); color: #1a1206; border: none; }
.btn-amber:hover { background: #d97706; color: #1a1206; }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.24); color: #fff; }

/* ---------- Category tiles ---------- */
.section { max-width: 1140px; margin: 3.25rem auto 0; padding: 0 1rem; }
.section-title { text-align: center; margin-bottom: .35rem; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 1.75rem; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem; }
.cat-tile {
    position: relative; height: 170px; border-radius: var(--radius); overflow: hidden; color: #fff;
    box-shadow: var(--shadow); display: block;
}
.cat-tile:hover { text-decoration: none; transform: translateY(-3px); transition: transform .15s ease; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile .cat-label {
    position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 1rem;
    background: linear-gradient(to top, rgba(2,6,23,.7), rgba(2,6,23,0) 60%); font-weight: 700; font-size: 1.1rem;
}

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.step-num { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-050); color: var(--brand-dark); font-weight: 800; display: grid; place-items: center; margin-bottom: .8rem; font-family: 'Poppins'; }

/* ---------- CTA band ---------- */
.cta-band {
    max-width: 1140px; margin: 3.25rem auto 0; border-radius: 24px; padding: 3rem 2rem; text-align: center; color: #fff;
    background: linear-gradient(120deg, var(--brand-dark), #1e3a8a);
}
.cta-band h2 { margin-bottom: 1rem; }
.cta-band .btn { border-radius: 999px; padding: .8rem 1.8rem; font-weight: 700; }

/* ---------- Auth ---------- */
.auth-card {
    max-width: 440px; margin-top: 3rem; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.25rem;
}
.social-btn { display: flex; align-items: center; justify-content: center; gap: .7rem; border-radius: 12px; font-weight: 600; border: 1px solid var(--line); }
.social-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.btn-google { background: #fff; color: #1f2937; border-color: #dadce0; }
.btn-google:hover { background: #f8f9fa; color: #1f2937; }
.btn-google .social-ico { background: #4285F4; }
.btn-facebook { background: #1877F2; color: #fff; border-color: #1877F2; }
.btn-facebook:hover { background: #166fe0; color: #fff; }
.btn-facebook .social-ico { background: #0b5fcc; }

/* ---------- Blazor defaults kept ---------- */
h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }
.darker-border-checkbox.form-check-input { border-color: #929292; }

.blazor-error-boundary {
    background: #b32121; padding: 1rem 1rem 1rem 1rem; color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }

@media (max-width: 640px) {
    .main-nav a:not(.btn-nav-solid) { display: none; }
    .hero-inner { padding: 3rem 1.5rem; }
}
