/* ── AUTH PAGES ── */
.auth-wrapper {
    min-height: 100vh;
    display   : flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2A2774 0%, #6C63FF 100%);
    padding   : 1rem;
}

.auth-card {
    background   : var(--bs-body-bg);
    border-radius: 20px;
    padding      : 2.5rem;
    width        : 100%;
    max-width    : 440px;
    box-shadow   : 0 25px 60px rgba(0,0,0,0.2);
}

.auth-logo {
    text-align   : center;
    margin-bottom: 2rem;
}
.auth-logo h1 {
    font-size  : 2rem;
    font-weight: 800;
    color      : #2A2774;
    letter-spacing: -1px;
}
[data-bs-theme="dark"] .auth-logo h1 { color: #9d97f5; }
.auth-logo p { color: var(--bs-secondary-color); font-size: 0.9rem; margin-top: 0.25rem; }

.auth-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.5rem; }

/* ── MODULE CARDS (Dashboard) ── */
.modules-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap                  : 1.5rem;
    margin-top           : 1.5rem;
}

.module-card {
    background   : var(--bs-body-bg);
    border       : 1.5px solid var(--bs-border-color);
    border-radius: 16px;
    padding      : 1.75rem;
    text-decoration: none;
    color        : inherit;
    transition   : all 0.25s;
    display      : block;
    position     : relative;
    overflow     : hidden;
}
.module-card::before {
    content   : '';
    position  : absolute;
    top       : 0; left: 0; right: 0;
    height    : 4px;
    background: var(--module-color, #2A2774);
}
.module-card:hover {
    transform : translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-color: transparent;
    color     : inherit;
    text-decoration: none;
}
.module-icon {
    width        : 52px;
    height       : 52px;
    border-radius: 12px;
    display      : flex;
    align-items  : center;
    justify-content: center;
    font-size    : 1.35rem;
    color        : white;
    margin-bottom: 1.25rem;
    background   : var(--module-color, #2A2774);
}
.module-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; }
.module-desc { font-size: 0.85rem; color: var(--bs-secondary-color); line-height: 1.5; }
.module-arrow {
    position  : absolute;
    bottom    : 1.25rem; right: 1.25rem;
    color     : var(--bs-secondary-color);
    font-size : 0.85rem;
    opacity   : 0;
    transition: opacity 0.2s;
}
.module-card:hover .module-arrow { opacity: 1; }
.module-locked { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.badge-locked {
    position  : absolute;
    top       : 1rem; right: 1rem;
    background: var(--bs-border-color);
    color     : var(--bs-secondary-color);
    font-size : 0.7rem;
    font-weight: 600;
    padding   : 0.2rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .auth-card { padding: 1.75rem 1.25rem; border-radius: 16px; }
    .modules-grid { grid-template-columns: 1fr; gap: 0.875rem; }
}

/* ── BOTTOM SHEET GLOBAL IMPROVEMENTS ── */
/* Give bottom sheets more breathing room — 96% of viewport */
.offcanvas-bottom {
    max-height: 96vh !important;
}
@supports (height: 1svh) {
    /* svh = small viewport height (excludes mobile browser chrome) — more space */
    .offcanvas-bottom { max-height: 96svh !important; }
}
/* Smooth scroll + prevent page scroll bleed on iOS */
.offcanvas-bottom .offcanvas-body {
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}
/* .sheet-footer: wrap save buttons in this div so they stick to the bottom */
.sheet-footer {
    position: sticky;
    bottom: 0;
    background: var(--bs-body-bg);
    padding-top: .75rem;
    margin-top: .5rem;
    z-index: 2;
}

/* ── OFFCANVAS BOTTOM → CENTERED ON DESKTOP ── */
/* On md+ screens, bottom offcanvas appears as a centered dialog instead of full-width bottom sheet */
@media (min-width: 768px) {
    .offcanvas.offcanvas-bottom {
        left: 50% !important;
        right: auto !important;
        max-width: 640px !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -4px 40px rgba(0,0,0,.18) !important;
        transform: translateX(-50%) translateY(100%) !important;
    }
    .offcanvas.offcanvas-bottom.show {
        transform: translateX(-50%) translateY(0) !important;
    }
    .offcanvas.offcanvas-bottom.hiding {
        transform: translateX(-50%) translateY(100%) !important;
    }
}
