/* mybills — global visual system on top of Bootstrap 5.
   Design tokens are declared once as CSS variables so Bootstrap keeps its
   defaults while custom surfaces (auth pages, hero) share one aesthetic. */

:root {
    --mb-brand: #2f6feb;
    --mb-brand-strong: #1f4fbf;
    --mb-brand-soft: #eaf0ff;
    --mb-accent: #7c3aed;

    --mb-surface: #ffffff;
    --mb-surface-muted: #f5f7fb;
    --mb-border: #e3e7ef;

    --mb-radius-sm: 0.5rem;
    --mb-radius-md: 0.85rem;
    --mb-radius-lg: 1.25rem;

    --mb-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --mb-shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.18),
                    0 4px 10px -6px rgba(15, 23, 42, 0.08);
    --mb-shadow-lg: 0 25px 60px -20px rgba(15, 23, 42, 0.25),
                    0 8px 20px -10px rgba(15, 23, 42, 0.12);
}

body {
    background-color: var(--mb-surface-muted);
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Larger tap targets on touch devices — helps mobile auth forms. */
@media (hover: none) and (pointer: coarse) {
    .form-control, .form-select, .btn {
        min-height: 44px;
    }
}

/* --------------------------------------------------------------------
   Auth / public shell — used by security/* templates.
   Provides a centered card that spans full width on mobile and is
   constrained on desktop, with a soft brand-tinted background.
   -------------------------------------------------------------------- */

body.auth-page {
    background:
        radial-gradient(circle at 15% 0%, rgba(47, 111, 235, 0.14), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(124, 58, 237, 0.10), transparent 40%),
        var(--mb-surface-muted);
}

body.auth-page > main.container {
    /* Cancel the horizontal container so the shell can center vertically. */
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 220px); /* nav + footer approx */
    padding: 2.5rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--mb-surface);
    border: 1px solid var(--mb-border);
    border-radius: var(--mb-radius-lg);
    box-shadow: var(--mb-shadow-md);
    padding: 2rem;
}

.auth-card__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--mb-brand);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.auth-card__brand i {
    font-size: 1.25rem;
}

.auth-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.auth-card__subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.auth-card .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

.auth-card .form-control {
    border-radius: var(--mb-radius-sm);
    padding: 0.65rem 0.85rem;
    border-color: var(--mb-border);
    background-color: #fbfcfe;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.auth-card .form-control:focus {
    background-color: #ffffff;
    border-color: var(--mb-brand);
    box-shadow: 0 0 0 0.2rem rgba(47, 111, 235, 0.15);
}

.auth-card .btn-primary {
    background-color: var(--mb-brand);
    border-color: var(--mb-brand);
    padding: 0.65rem 1.1rem;
    font-weight: 500;
    border-radius: var(--mb-radius-sm);
    box-shadow: var(--mb-shadow-sm);
}

.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
    background-color: var(--mb-brand-strong);
    border-color: var(--mb-brand-strong);
}

.auth-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.auth-card__actions .btn-primary {
    flex-grow: 1;
}

.auth-card__actions .btn-link {
    padding-left: 0;
    padding-right: 0;
    color: var(--mb-brand);
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-card__actions .btn-link:hover {
    text-decoration: underline;
}

.auth-card__footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--mb-border);
    color: #64748b;
    font-size: 0.9rem;
    text-align: center;
}

.auth-card__footer a {
    color: var(--mb-brand);
    text-decoration: none;
    font-weight: 500;
}

.auth-card__footer a:hover {
    text-decoration: underline;
}

@media (max-width: 400px) {
    .auth-shell {
        padding: 1rem 0.75rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--mb-radius-md);
    }

    .auth-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card__actions .btn-link {
        text-align: center;
    }
}

/* --------------------------------------------------------------------
   Landing hero — replaces the generic Bootstrap jumbotron on index.
   -------------------------------------------------------------------- */

.hero {
    position: relative;
    padding: 3.5rem 2rem;
    border-radius: var(--mb-radius-lg);
    color: #ffffff;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.20), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.12), transparent 45%),
        linear-gradient(135deg, #3a404b 0%, var(--mb-accent) 100%);
    box-shadow: var(--mb-shadow-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .hero {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hero__body {
        min-width: 0;
    }
}

.hero__body {
    display: flex;
    flex-direction: column;
}

.hero__eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.18);
    margin-bottom: 1.25rem;
}

.hero__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero__lead {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    align-self: start;
}

@media (min-width: 768px) {
    .hero__actions {
        flex-direction: column;
        align-items: stretch;
        align-self: center;
        min-width: 12rem;
    }
}

.hero__actions .btn-primary {
    background-color: #ffffff;
    color: var(--mb-brand-strong);
    border-color: #ffffff;
    font-weight: 600;
    padding: 0.7rem 1.4rem;
}

.hero__actions .btn-primary:hover,
.hero__actions .btn-primary:focus {
    background-color: #f1f5ff;
    color: var(--mb-brand-strong);
    border-color: #f1f5ff;
}

.hero__actions .btn-outline-primary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.7);
    background-color: transparent;
    font-weight: 600;
    padding: 0.7rem 1.4rem;
}

.hero__actions .btn-outline-primary:hover,
.hero__actions .btn-outline-primary:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: #ffffff;
}

@media (max-width: 575.98px) {
    .hero {
        padding: 2.25rem 1.25rem;
        border-radius: var(--mb-radius-md);
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --------------------------------------------------------------------
   Feature panels — three equal-height cards below the hero.
   The row uses .row with .g-4 so Bootstrap handles the gaps; each
   .feature-panel forces its own body to fill the tallest column via
   flex + h-100 (applied through Bootstrap utilities in the template).
   -------------------------------------------------------------------- */

.feature-panel {
    background: var(--mb-surface);
    border: 1px solid var(--mb-border);
    border-radius: var(--mb-radius-lg);
    box-shadow: var(--mb-shadow-sm);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.feature-panel:hover {
    transform: translateY(-2px);
    border-color: rgba(47, 111, 235, 0.35);
    box-shadow: var(--mb-shadow-md);
}

.feature-panel__header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.feature-panel__title-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: var(--mb-brand-soft);
    color: var(--mb-brand-strong);
    font-size: 0.85rem;
    font-weight: 600;
}

.feature-panel__header-action {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feature-panel__header-action .btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.9rem;
    border-radius: var(--mb-radius-sm);
}

.feature-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--mb-radius-md);
    background: var(--mb-brand-soft);
    color: var(--mb-brand-strong);
    font-size: 1.35rem;
}

.feature-panel__title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.feature-panel__text {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

.feature-panel .table {
    color: #334155;
    margin-bottom: 0;
}

.feature-panel .table > :not(caption) > * > * {
    padding: 0.4rem 0.5rem;
}

.feature-panel dl {
    margin-bottom: 0;
}

.feature-panel .progress {
    background-color: #eef1f7;
}

.feature-panel__stats {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 0.35rem;
    column-gap: 1rem;
    font-size: 0.92rem;
    color: #334155;
    margin: 0;
}

.feature-panel__stats dt {
    font-weight: 500;
    color: #475569;
}

.feature-panel__stats dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.feature-panel__action {
    margin-top: auto;
    padding-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feature-panel__action .btn {
    padding: 0.55rem 1.15rem;
    font-weight: 500;
    border-radius: var(--mb-radius-sm);
}

.feature-panel__action .btn-primary {
    background-color: var(--mb-brand);
    border-color: var(--mb-brand);
    box-shadow: var(--mb-shadow-sm);
}

.feature-panel__action .btn-primary:hover,
.feature-panel__action .btn-primary:focus {
    background-color: var(--mb-brand-strong);
    border-color: var(--mb-brand-strong);
}

.feature-panel--accent {
    background:
        radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.10), transparent 55%),
        linear-gradient(135deg, #ffffff 0%, #f6f2ff 100%);
    border-color: rgba(124, 58, 237, 0.25);
}

.feature-panel__icon--accent {
    background: linear-gradient(135deg, var(--mb-brand) 0%, var(--mb-accent) 100%);
    color: #ffffff;
}
