/* ============================================================================
 * Zanaco Self-Service Portal — modern-ui.css
 * ----------------------------------------------------------------------------
 * Brand colours: black, red (#C21C1D), white.
 *
 * Organisation:
 *   1.  Variables and fonts
 *   2.  Base body and global resets
 *   3.  Layout (container, page shell, content)
 *   4.  Navbar (topbar, brand, mobile collapse, nav links, sign-out)
 *   5.  Page panels (auth-card, experience-panel, statement-hero)
 *   6.  Cards (step, trust, insight, metric, preview)
 *   7.  Forms (form-control, label, field-card, errors)
 *   8.  Buttons (btn-auth, btn-reset, btn-view, with all states)
 *   9.  Modals (base, header/body/footer, OTP-specific bits)
 *   10. Components (info-banner, account-overview, otp-resend, footer card)
 *   11. Vendor overrides (sweet-alert, datepicker)
 *   12. Global white-surface override (legacy compatibility)
 *   13. Responsive (991 → tablet, 767 → mobile, 480 → small mobile)
 * ========================================================================= */


/* ============================================================================
 * 1. Variables and fonts
 * ========================================================================= */

:root {
    /* Brand */
    --brand-red: #C21C1D;
    --brand-red-deep: #9b1718;
    --brand-red-pressed: #7a1314;
    --brand-red-soft: rgba(194, 28, 29, 0.14);
    --brand-red-glow: rgba(194, 28, 29, 0.3);
    --brand-black: #000000;
    --brand-black-soft: #2c2c2c;
    --brand-white: #ffffff;

    /* Text */
    --text-primary: #111111;
    --text-secondary: #5f6368;

    /* Surfaces and borders */
    --border-soft: rgba(17, 17, 17, 0.08);
    --border-medium: rgba(17, 17, 17, 0.12);
    --surface-muted: rgba(0, 0, 0, 0.06);

    /* Shadows — semantic names so usage tells you intent */
    --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 14px 30px rgba(0, 0, 0, 0.1);
    --shadow-button-primary: 0 14px 30px rgba(194, 28, 29, 0.28);
    --shadow-button-primary-hover: 0 18px 36px rgba(194, 28, 29, 0.36);
    --shadow-button-primary-pressed: 0 6px 14px rgba(194, 28, 29, 0.18);
    --shadow-button-secondary: 0 12px 26px rgba(0, 0, 0, 0.08);

    /* Radii */
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --radius-pill: 999px;

    /* Timing */
    --transition-fast: 0.08s ease;
    --transition-base: 0.18s ease;
    --transition-layout: 0.25s ease;
}

@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Regular.woff2') format('woff2'),
    url('../fonts/Gilroy-Regular.woff')  format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Bold.woff2') format('woff2'),
    url('../fonts/Gilroy-Bold.woff')  format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* ============================================================================
 * 2. Base body and global resets
 * ========================================================================= */

body.modern-ui {
    background: var(--brand-white);
    color: var(--text-primary);
    font-family: 'Gilroy', 'Roboto', sans-serif;
}

/* Hide vendor (SmartAdmin) chrome we don't use */
body.modern-ui #leftsidebar,
body.modern-ui #rightsidebar,
body.modern-ui .overlay,
body.modern-ui .bars,
body.modern-ui .navbar-toggle {
    display: none !important;
}

body.modern-ui section {
    padding-left: 0;
}

body.modern-ui label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand-black);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

body.modern-ui .page-loader-wrapper {
    background: rgba(255, 255, 255, 0.92);
}

body.modern-ui .spinner-layer.pl-red .circle {
    border-color: var(--brand-red);
}

body.modern-ui .page-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: var(--brand-white);
    z-index: -2;
}


/* ============================================================================
 * 3. Layout (container, page shell, content)
 * ========================================================================= */

body.modern-ui .container-fluid {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding-left: 18px;
    padding-right: 18px;
}

body.modern-ui section.content,
body.modern-ui main.content {
    margin-left: 0 !important;
    margin-top: 0 !important;
    padding: 20px 0 30px;
}

body.modern-ui .modern-page-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

body.modern-ui .page-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

body.modern-ui .page-grid > [class*='col-'] {
    margin-bottom: 20px;
}


/* ============================================================================
 * 4. Navbar
 * ----------------------------------------------------------------------------
 * Three states:
 *   Desktop (>991px) — full bar with brand+subtitle and inline nav
 *   Tablet  (768–991) — same content, brand stacks above nav
 *   Mobile  (<767px)  — compact 64px bar with hamburger toggle
 *
 * Sticky at all widths so Sign Out stays reachable on long pages.
 * The mobile collapse, hamburger animation, and chip-hide rules live in
 * section 13 (responsive) since they're media-query-bound.
 * ========================================================================= */

body.modern-ui .navbar.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: auto;
    background: rgba(0, 0, 0, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

body.modern-ui .app-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 88px;
    padding-top: 14px;
    padding-bottom: 14px;
}

/* ── Brand ───────────────────────────────────────────────────────── */

body.modern-ui .app-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--brand-white);
    text-decoration: none;
    flex: 0 1 auto;
    max-width: 60%;
    min-width: 0;
}

body.modern-ui .app-brand:hover,
body.modern-ui .app-brand:focus-visible {
    color: var(--brand-white);
    text-decoration: none;
    outline: none;
}

body.modern-ui .app-brand-logo-img {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

body.modern-ui .app-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

body.modern-ui .app-brand-copy strong {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.modern-ui .app-brand-copy small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Mobile actions row (sign-out icon + hamburger) ──────────────── */
/* Hidden on desktop, revealed in section 13. */

body.modern-ui .app-topbar-mobile-actions {
    display: none;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

body.modern-ui .top-nav-signout-form--mobile {
    display: inline;
    margin: 0;
    padding: 0;
}

body.modern-ui .top-nav-signout-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--brand-white);
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base);
}

body.modern-ui .top-nav-signout-mobile:hover,
body.modern-ui .top-nav-signout-mobile:focus-visible {
    background: rgba(194, 28, 29, 0.2);
    border-color: rgba(194, 28, 29, 0.5);
    outline: none;
}

body.modern-ui .top-nav-signout-mobile .material-icons {
    font-size: 20px;
}

body.modern-ui .app-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: var(--brand-white);
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base);
}

body.modern-ui .app-nav-toggle:hover,
body.modern-ui .app-nav-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.32);
    outline: none;
}

body.modern-ui .app-nav-toggle-icon {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 16px;
}

body.modern-ui .app-nav-toggle-icon span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-white);
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base), top var(--transition-base);
}

body.modern-ui .app-nav-toggle-icon span:nth-child(1) { top: 0; }
body.modern-ui .app-nav-toggle-icon span:nth-child(2) { top: 7px; }
body.modern-ui .app-nav-toggle-icon span:nth-child(3) { top: 14px; }

body.modern-ui .app-topbar.is-open .app-nav-toggle-icon span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
}

body.modern-ui .app-topbar.is-open .app-nav-toggle-icon span:nth-child(2) {
    opacity: 0;
}

body.modern-ui .app-topbar.is-open .app-nav-toggle-icon span:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
}

/* ── Nav shell and links ─────────────────────────────────────────── */

body.modern-ui .app-nav-shell {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.modern-ui .app-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.modern-ui .top-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.96);
    color: var(--brand-black);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform var(--transition-base), background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

body.modern-ui .top-nav-link:hover,
body.modern-ui .top-nav-link:focus-visible {
    background: rgba(194, 28, 29, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--brand-red);
    text-decoration: none;
    transform: translateY(-1px);
    outline: none;
}

/* ── Sign-out (desktop) ──────────────────────────────────────────── */

body.modern-ui .top-nav-signout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

body.modern-ui button.top-nav-signout {
    background: var(--brand-white);
    border: 1px solid rgba(194, 28, 29, 0.26);
    color: var(--brand-red);
    box-shadow: 0 12px 24px rgba(194, 28, 29, 0.12);
    font: inherit;
    cursor: pointer;
}

body.modern-ui button.top-nav-signout:hover,
body.modern-ui button.top-nav-signout:focus-visible {
    background: var(--brand-white);
    border-color: rgba(194, 28, 29, 0.34);
    color: var(--brand-red);
    outline: none;
}

/* User-name chip — sits inline next to Sign Out on the same baseline */
body.modern-ui .top-nav-user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================================
 * 5. Page panels (auth-card, experience-panel, statement-hero)
 * ========================================================================= */

body.modern-ui .experience-panel,
body.modern-ui .detail-panel,
body.modern-ui .auth-card,
body.modern-ui .statement-preview-card,
body.modern-ui .app-footer-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

body.modern-ui .experience-panel,
body.modern-ui .detail-panel {
    height: 100%;
    padding: 30px;
    background:
            linear-gradient(160deg, rgba(194, 28, 29, 0.08), rgba(194, 28, 29, 0.02)),
            linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 251, 251, 0.96));
    border: 1px solid rgba(194, 28, 29, 0.1);
}

body.modern-ui .experience-panel::after,
body.modern-ui .detail-panel::after,
body.modern-ui .auth-card::before,
body.modern-ui .statement-preview-card::before,
body.modern-ui .app-footer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(194, 28, 29, 0.08);
}

body.modern-ui .experience-title {
    margin: 18px 0 12px;
    color: var(--brand-black);
    font-size: 40px;
    line-height: 1.08;
    font-weight: 900;
}

body.modern-ui .experience-copy {
    margin: 0;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
}

body.modern-ui .auth-card {
    background: var(--brand-white);
    border: 1px solid rgba(17, 17, 17, 0.1);
    color: var(--text-primary);
    height: 100%;
}

body.modern-ui .auth-body {
    position: relative;
    z-index: 1;
    padding: 30px;
}

body.modern-ui .logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

body.modern-ui .logo-container img {
    max-width: 150px;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.12));
}

body.modern-ui .logo-container--compact img {
    max-width: 120px;
}

body.modern-ui .card-section-title h2,
body.modern-ui .auth-header h2 {
    margin: 0 0 8px;
    color: var(--brand-black);
    font-size: 30px;
    font-weight: 800;
}

body.modern-ui .modern-intro-text {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

body.modern-ui .statement-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 30px;
    border-radius: var(--radius-lg);
    background:
            linear-gradient(140deg, rgba(194, 28, 29, 0.1), rgba(194, 28, 29, 0.03)),
            linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 251, 251, 0.97));
    border: 1px solid rgba(194, 28, 29, 0.1);
    box-shadow: var(--shadow-card);
}

body.modern-ui .statement-hero-copy {
    max-width: 760px;
}


/* ============================================================================
 * 6. Cards (step, trust, insight, metric, preview, footer)
 * ========================================================================= */

body.modern-ui .step-list {
    margin-top: 28px;
    display: grid;
    gap: 16px;
}

body.modern-ui .step-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(194, 28, 29, 0.1);
    box-shadow: 0 12px 30px rgba(194, 28, 29, 0.06);
}

body.modern-ui .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--brand-red), var(--brand-red-deep));
    color: var(--brand-white);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

body.modern-ui .step-item h4 {
    margin: 2px 0 6px;
    color: var(--brand-black);
    font-size: 17px;
    font-weight: 700;
}

body.modern-ui .step-item p,
body.modern-ui .trust-card span,
body.modern-ui .preview-header p,
body.modern-ui .app-footer-meta p,
body.modern-ui .insight-card span,
body.modern-ui .otp-helper {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

body.modern-ui .step-item .step-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.4;
}

body.modern-ui .step-item .step-note-icon {
    font-size: 14px;
    color: #94a3b8;
}

body.modern-ui .trust-grid,
body.modern-ui .detail-grid,
body.modern-ui .statement-form-grid,
body.modern-ui .insight-strip,
body.modern-ui .app-footer-links {
    display: grid;
    gap: 16px;
}

body.modern-ui .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
}

body.modern-ui .trust-card,
body.modern-ui .insight-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(194, 28, 29, 0.1);
}

body.modern-ui .trust-card strong,
body.modern-ui .insight-card strong,
body.modern-ui .preview-header h3,
body.modern-ui .app-footer-meta h4 {
    color: var(--brand-black);
    font-weight: 700;
    margin: 0;
}

body.modern-ui .insight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

body.modern-ui .insight-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    background: rgba(194, 28, 29, 0.06);
    border-color: rgba(194, 28, 29, 0.12);
}

body.modern-ui .insight-card .material-icons {
    color: var(--brand-red);
    font-size: 22px;
}

body.modern-ui .auth-card .insight-card strong {
    color: var(--brand-black);
}

body.modern-ui .auth-card .insight-card span {
    color: var(--text-secondary);
}

body.modern-ui .metric-row,
body.modern-ui .statement-hero-highlights {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
}

body.modern-ui .metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(194, 28, 29, 0.12);
    color: var(--brand-black);
    font-size: 13px;
    font-weight: 600;
}

body.modern-ui .metric-pill .material-icons {
    font-size: 18px;
    color: var(--brand-red);
}

body.modern-ui .statement-preview-card {
    margin-top: 22px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 251, 251, 0.97));
    border: 1px solid rgba(194, 28, 29, 0.1);
}

body.modern-ui .preview-header {
    margin-bottom: 16px;
}

body.modern-ui .preview-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 180px;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(194, 28, 29, 0.18);
    background: rgba(194, 28, 29, 0.04);
    color: var(--text-secondary);
    text-align: center;
}

body.modern-ui .preview-empty-state .material-icons {
    font-size: 36px;
    color: var(--brand-red);
}

body.modern-ui .preview-empty-state.is-hidden {
    display: none;
}

body.modern-ui .statement-content,
body.modern-ui .timeout-activity-log {
    border-radius: var(--radius-md);
    border: 1px solid rgba(194, 28, 29, 0.1);
    background: rgba(255, 255, 255, 0.98);
    overflow: hidden;
}

/* Eyebrow / panel-badge — small uppercase brand-tinted tag */
body.modern-ui .panel-badge,
body.modern-ui .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(194, 28, 29, 0.14);
    background: rgba(194, 28, 29, 0.07);
    color: var(--brand-red);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

body.modern-ui .panel-badge {
    margin-bottom: 18px;
    background: var(--brand-red-soft);
    border-color: rgba(194, 28, 29, 0.24);
}


/* ============================================================================
 * 7. Forms (form-control, label, field-card, errors)
 * ========================================================================= */

body.modern-ui .field-grid,
body.modern-ui .statement-form-grid,
body.modern-ui .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.modern-ui .field-card {
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--brand-white);
    border: 1px solid var(--border-soft);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

body.modern-ui .form-group {
    margin-bottom: 16px;
}

body.modern-ui .form-control {
    width: 100%;
    height: 54px;
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    background: #fbfbfb;
    color: var(--brand-black);
    box-shadow: none;
    padding: 14px 16px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

body.modern-ui textarea.form-control {
    min-height: 110px;
}

body.modern-ui .form-control:focus,
body.modern-ui .form-control:focus-visible {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 4px rgba(194, 28, 29, 0.12);
    background: var(--brand-white);
    outline: none;
}

body.modern-ui .form-control[disabled],
body.modern-ui .form-control[readonly] {
    background: linear-gradient(180deg, #f6f6f6, #f1f1f1);
    color: #3d3d3d;
    border-color: var(--border-soft);
}

body.modern-ui .form-note {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

body.modern-ui .error-message {
    display: block;
    margin-top: 8px;
    color: var(--brand-red);
    font-size: 12px;
    font-weight: 600;
}

body.modern-ui .has-error .form-control,
body.modern-ui .form-control.is-invalid {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 4px rgba(194, 28, 29, 0.08);
}

body.modern-ui .form-control.is-valid {
    border-color: #2c9b4b !important;
}


/* ============================================================================
 * 8. Buttons (btn-auth, btn-reset, btn-view)
 * ----------------------------------------------------------------------------
 * Three states beyond default: hover (lift), active (press), focus-visible
 * (keyboard ring), disabled (greyed).
 * ========================================================================= */

body.modern-ui .btn-auth,
body.modern-ui .btn-reset,
body.modern-ui .btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 22px;
    border-radius: var(--radius-pill);
    border: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
    -webkit-font-smoothing: antialiased;
}

body.modern-ui .modern-btn-icon,
body.modern-ui .modern-field-icon {
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
}

/* ── Primary (.btn-auth) ─────────────────────────────────────────── */

body.modern-ui .btn-auth {
    background: linear-gradient(145deg, var(--brand-red), var(--brand-red-deep));
    color: var(--brand-white);
    box-shadow: var(--shadow-button-primary),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

body.modern-ui .btn-auth:hover {
    color: var(--brand-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-primary-hover),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

body.modern-ui .btn-auth:active {
    background: linear-gradient(145deg, var(--brand-red-deep), var(--brand-red-pressed));
    transform: scale(0.98);
    box-shadow: var(--shadow-button-primary-pressed),
    0 1px 2px rgba(0, 0, 0, 0.1) inset;
    transition-duration: 0.08s;
}

body.modern-ui .btn-auth:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-primary-hover),
    0 0 0 4px var(--brand-red-glow);
    color: var(--brand-white);
}

body.modern-ui .btn-auth:disabled,
body.modern-ui .btn-auth[aria-disabled="true"] {
    background: #d8d8d8;
    color: #8a8a8a;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

body.modern-ui .btn-auth:disabled:hover,
body.modern-ui .btn-auth:disabled:focus {
    background: #d8d8d8;
    color: #8a8a8a;
    transform: none;
    box-shadow: none;
}

/* ── Secondary (.btn-reset, .btn-view) ───────────────────────────── */

body.modern-ui .btn-reset,
body.modern-ui .btn-view {
    background: var(--brand-white);
    color: var(--brand-black);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-button-secondary);
}

body.modern-ui .btn-view {
    /* Suggests "review your statement" affordance */
    border-color: rgba(194, 28, 29, 0.22);
}

body.modern-ui .btn-reset:hover,
body.modern-ui .btn-view:hover {
    color: var(--brand-black);
    background: #fafafa;
    border-color: rgba(194, 28, 29, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

body.modern-ui .btn-view:hover {
    border-color: rgba(194, 28, 29, 0.4);
    color: var(--brand-red-deep);
}

body.modern-ui .btn-reset:active,
body.modern-ui .btn-view:active {
    background: #f0f0f0;
    transform: scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition-duration: var(--transition-fast);
}

body.modern-ui .btn-reset:focus-visible,
body.modern-ui .btn-view:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover),
    0 0 0 4px rgba(194, 28, 29, 0.18);
}

body.modern-ui .btn-reset:disabled,
body.modern-ui .btn-view:disabled,
body.modern-ui .btn-reset[aria-disabled="true"],
body.modern-ui .btn-view[aria-disabled="true"] {
    background: #f4f4f4;
    color: #999;
    border-color: var(--border-soft);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

body.modern-ui .btn-view a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

body.modern-ui .btn.btn-auth,
body.modern-ui .btn.btn-reset,
body.modern-ui .btn.btn-view,
body.modern-ui .modal-footer .btn-auth,
body.modern-ui .modal-footer .btn-reset,
body.modern-ui .modal-footer .btn-view,
body.modern-ui .modern-modal-footer .btn-auth,
body.modern-ui .modern-modal-footer .btn-reset,
body.modern-ui .modern-modal-footer .btn-view {
    border-radius: var(--radius-pill) !important;
    min-height: 52px;
    padding: 0 22px;
    font-weight: 700;
}

body.modern-ui .btn.btn-auth,
body.modern-ui .modal-footer .btn-auth,
body.modern-ui .modern-modal-footer .btn-auth {
    background: linear-gradient(145deg, var(--brand-red), var(--brand-red-deep)) !important;
    color: var(--brand-white) !important;
    border: 0 !important;
}

body.modern-ui .btn.btn-auth:hover,
body.modern-ui .modal-footer .btn-auth:hover,
body.modern-ui .modern-modal-footer .btn-auth:hover {
    color: var(--brand-white) !important;
}

body.modern-ui .btn.btn-reset,
body.modern-ui .modal-footer .btn-reset,
body.modern-ui .modern-modal-footer .btn-reset {
    background: var(--brand-white) !important;
    color: var(--brand-black) !important;
    border: 1px solid var(--border-medium) !important;
}

body.modern-ui .btn.btn-reset:hover,
body.modern-ui .modal-footer .btn-reset:hover,
body.modern-ui .modern-modal-footer .btn-reset:hover {
    background: #fafafa !important;
    color: var(--brand-black) !important;
    border-color: rgba(194, 28, 29, 0.3) !important;
}

body.modern-ui .btn.btn-view,
body.modern-ui .modal-footer .btn-view,
body.modern-ui .modern-modal-footer .btn-view {
    background: var(--brand-white) !important;
    color: var(--brand-black) !important;
    border: 1px solid rgba(194, 28, 29, 0.22) !important;
}

body.modern-ui .btn.btn-view:hover,
body.modern-ui .modal-footer .btn-view:hover,
body.modern-ui .modern-modal-footer .btn-view:hover {
    background: var(--brand-white) !important;
    color: var(--brand-red-deep) !important;
    border-color: rgba(194, 28, 29, 0.4) !important;
}

/* Action row container — laid out next to or stacking buttons */
body.modern-ui .action-row {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

body.modern-ui .action-row--statement {
    margin-top: 18px;
}

/* Processing indicator — shown while a button-triggered request is in flight */
body.modern-ui .processing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(194, 28, 29, 0.18);
    background: rgba(194, 28, 29, 0.08);
}

body.modern-ui .processing-text {
    color: var(--brand-red-deep);
    font-weight: 700;
}

body.modern-ui .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 3px solid rgba(194, 28, 29, 0.2);
    border-top-color: var(--brand-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ============================================================================
 * 9. Modals
 * ========================================================================= */

body.modern-ui .modal-content,
body.modern-ui .modern-modal-card,
body.modern-ui .loader-modal-card {
    border: 1px solid rgba(194, 28, 29, 0.16);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* ── Modal header ──────────────────────────────────────────────────
   Layout is flex with the title on the left and the close button on
   the right. The h5.modal-title gets margin: 0 (defeats browser
   default), display: inline-flex with gap so the icon and text share
   a baseline. Padding bumped to 22px so the title has breathing room
   at the top of the red header. */

body.modern-ui .modern-modal-header {
    background: linear-gradient(145deg, var(--brand-red), var(--brand-red-deep));
    border: 0;
    color: var(--brand-white);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.modern-ui .modern-modal-header .modal-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--brand-white);
}

body.modern-ui .modern-modal-header .modal-title .material-icons,
body.modern-ui .modern-modal-header .modal-title .modern-btn-icon {
    font-size: 22px;
    line-height: 1;
    /* Slight downward shift to optically center the icon with the
       text. Material icons sit slightly high relative to typography. */
    margin-top: -1px;
}

body.modern-ui .modern-modal-header .btn-close,
body.modern-ui .modern-modal-header .modern-modal-close {
    margin: 0;
    padding: 8px;
    flex-shrink: 0;
    /* Bootstrap's btn-close uses an SVG background image. Invert it
       so the X appears white against the red header. */
    filter: invert(1) grayscale(1) brightness(2);
    opacity: 1;
}

body.modern-ui .modern-modal-body {
    padding: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 247, 0.95));
}

body.modern-ui .modern-modal-close {
    color: var(--brand-white);
    opacity: 1;
}

body.modern-ui .modern-modal-close.btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

body.modern-ui .modern-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 24px 24px;
    border-top: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 247, 0.95));
}

body.modern-ui .loader-modal-card {
    background: rgba(255, 255, 255, 0.98);
}

body.modern-ui .loader-modal-card .modal-body {
    padding: 26px;
}

/* ── OTP modal-specific bits ──────────────────────────────────────── */

body.modern-ui .otp-illustration {
    margin-bottom: 18px;
}

body.modern-ui .otp-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    margin-bottom: 12px;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--brand-red), var(--brand-red-deep));
    color: var(--brand-white);
    box-shadow: 0 18px 34px rgba(194, 28, 29, 0.24);
}

body.modern-ui .otp-icon-wrap .material-icons {
    font-size: 34px;
}

body.modern-ui .otp-illustration h5 {
    margin: 0 0 8px;
    color: var(--brand-black);
    font-size: 24px;
    font-weight: 800;
}

body.modern-ui .otp-helper {
    color: var(--text-secondary);
}

body.modern-ui .modern-otp-input {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.2em;
}

/* ── Body padding override ─────────────────────────────────────────
   The default .modern-modal-body has 24px padding which eats space
   for the PDF. Zero it out so the iframe gets the full body width. */
body.modern-ui .statement-viewer-modal-card .statement-viewer-body {
    padding: 0;
    background: var(--brand-white);
}

/* ── Viewer container — holds the iframe (or PDF.js canvas) ────────
   min-height keeps the modal sized while the loading state is shown.
   On fullscreen-sm-down (mobile) the modal flexes to viewport, so
   min-height switches to a height-based rule there. */
body.modern-ui .statement-viewer-frame-container {
    position: relative;
    min-height: 70vh;
    background: #f5f5f5;
    overflow: auto;
}

body.modern-ui .statement-viewer-frame-container iframe,
body.modern-ui .statement-viewer-frame-container embed,
body.modern-ui .statement-viewer-frame-container object {
    /* Whatever the JS injects for rendering, give it the full container */
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
    background: var(--brand-white);
}

/* ── Loading state — centered spinner + message ──────────────────── */
body.modern-ui .statement-viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-secondary);
    background: var(--brand-white);
}

body.modern-ui .statement-viewer-loading .spinner {
    /* Slightly larger than the form-level spinner */
    width: 32px;
    height: 32px;
    border-width: 4px;
    margin: 0;
}

body.modern-ui .statement-viewer-loading p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Mobile notice — shown only on phones (d-md-none in markup) ────
   Same visual language as .info-banner so it feels familiar. */
body.modern-ui .statement-viewer-mobile-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    background: rgba(194, 28, 29, 0.06);
    border-bottom: 1px solid rgba(194, 28, 29, 0.14);
    line-height: 1.5;
}

body.modern-ui .statement-viewer-mobile-notice > i.material-icons {
    flex-shrink: 0;
    font-size: 22px;
    color: var(--brand-red);
    margin-top: 2px;
}

body.modern-ui .statement-viewer-mobile-notice strong {
    display: block;
    margin-bottom: 4px;
    color: var(--brand-black);
    font-size: 14px;
}

body.modern-ui .statement-viewer-mobile-notice p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

body.modern-ui .statement-viewer-mobile-notice a {
    color: var(--brand-red);
    font-weight: 600;
    text-decoration: underline;
}

body.modern-ui .statement-viewer-mobile-notice a:hover,
body.modern-ui .statement-viewer-mobile-notice a:focus-visible {
    color: var(--brand-red-deep);
}


/* ============================================================================
 * 10. Components (info-banner, account-overview, otp-resend, footer card)
 * ========================================================================= */

/* ── Info banners (neutral, success) ──────────────────────────────── */

body.modern-ui .info-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    line-height: 1.5;
}

body.modern-ui .info-banner > i.material-icons {
    flex-shrink: 0;
    font-size: 22px;
    margin-top: 2px;
}

body.modern-ui .info-banner strong {
    display: block;
    margin-bottom: 4px;
    color: #0f172a;
    font-size: 15px;
}

body.modern-ui .info-banner p {
    margin: 0;
    font-size: 13.5px;
    color: #475569;
}

body.modern-ui .info-banner--neutral {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

body.modern-ui .info-banner--neutral > i.material-icons {
    color: #64748b;
}

body.modern-ui .info-banner--success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
}

body.modern-ui .info-banner--success > i.material-icons {
    color: #059669;
}

body.modern-ui .info-banner--success strong {
    color: #064e3b;
}

body.modern-ui .info-banner--success p {
    color: #047857;
}

/* ── Inactivity warning modal (red treatment) ─────────────────────── */

body.modern-ui #inactivityWarningModal .modal-header {
    background-color: var(--brand-red) !important;
    color: var(--brand-white) !important;
}

body.modern-ui #inactivityWarningModal .alert-warning {
    border: 1px solid var(--brand-red);
    background-color: rgba(194, 28, 29, 0.08);
    color: var(--brand-red);
}

body.modern-ui #inactivityWarningModal #countdown {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-red);
    text-align: center;
    margin: 15px 0;
}

/* Other timeout / info alerts */
body.modern-ui .timeout-alert,
body.modern-ui .alert-info {
    border: 1px solid rgba(194, 28, 29, 0.18);
    border-left: 4px solid var(--brand-red);
    background: rgba(194, 28, 29, 0.08);
    color: var(--brand-black);
}

/* ── Account overview (warm greeting + metadata strip) ────────────── */

body.modern-ui .account-overview {
    background: var(--brand-white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    box-shadow: var(--shadow-card);
}

body.modern-ui .account-overview__greeting {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

body.modern-ui .account-overview__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(194, 28, 29, 0.06);
    border: 1px solid rgba(194, 28, 29, 0.18);
    color: var(--brand-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    text-transform: uppercase;
}

body.modern-ui .account-overview__greeting-text {
    flex: 1;
    min-width: 0;
}

body.modern-ui .account-overview__eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

body.modern-ui .account-overview__name {
    margin: 0;
    font-family: 'Gilroy', 'Roboto', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--brand-black);
    word-break: break-word;
}

body.modern-ui .account-overview__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

body.modern-ui .account-overview__meta-item {
    padding: 0 22px;
    border-left: 1px solid var(--border-soft);
    min-width: 0;
}

body.modern-ui .account-overview__meta-item:first-child {
    padding-left: 0;
    border-left: 0;
}

body.modern-ui .account-overview__meta-item:last-child {
    padding-right: 0;
}

body.modern-ui .account-overview__meta dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

body.modern-ui .account-overview__meta dd {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--brand-black);
    word-break: break-word;
}

body.modern-ui .account-overview__meta dd.is-mono {
    font-family: 'Roboto Mono', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ── Balance strip ────────────────────────────────────────────────────
   A second three-up row under the account metadata. Reuses the meta grid
   so it inherits the same columns, dividers and single-column stacking on
   mobile; only the emphasis on the figures is new — these are the numbers
   a customer came to read, so they carry more weight than "Email on file"
   above them. */

body.modern-ui .account-overview__meta--balances {
    padding-top: 16px;
}

body.modern-ui .account-overview__meta--balances dd.is-mono.is-figure {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    /* Figures line up column to column even when the digit counts differ. */
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body.modern-ui .account-overview__balances-note {
    margin: 10px 0 0;
    font-size: 11px;
    color: var(--text-secondary);
}

@media (max-width: 767px) {
    body.modern-ui .account-overview__meta--balances dd.is-mono.is-figure {
        font-size: 16px;
        /* Long figures may wrap on a narrow screen rather than overflow. */
        white-space: normal;
    }
}

/* ── OTP resend (link-style action) ───────────────────────────────── */

body.modern-ui .otp-resend-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
}

body.modern-ui .otp-resend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-red);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-base), color var(--transition-base);
}

body.modern-ui .otp-resend-btn:hover {
    color: var(--brand-red-deep);
    border-bottom-color: var(--brand-red-deep);
}

body.modern-ui .otp-resend-btn:focus-visible {
    outline: none;
    color: var(--brand-red-deep);
    border-bottom-color: var(--brand-red-deep);
    box-shadow: 0 0 0 3px rgba(194, 28, 29, 0.18);
    border-radius: 2px;
}

body.modern-ui .otp-resend-btn:active {
    color: var(--brand-red-pressed);
    border-bottom-color: var(--brand-red-pressed);
}

body.modern-ui .otp-resend-btn:disabled,
body.modern-ui .otp-resend-btn[aria-disabled="true"] {
    color: #999;
    border-bottom-color: transparent;
    cursor: not-allowed;
}

body.modern-ui .otp-resend-countdown,
body.modern-ui #otpResendCountdown {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ── App footer card (used by some pages) ─────────────────────────── */

body.modern-ui .app-footer {
    padding: 0 0 28px;
}

body.modern-ui .app-footer-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px;
    background:
            linear-gradient(145deg, rgba(194, 28, 29, 0.08), rgba(194, 28, 29, 0.02)),
            linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 251, 251, 0.97));
    border: 1px solid rgba(194, 28, 29, 0.1);
}

body.modern-ui .app-footer-meta {
    max-width: 700px;
}

body.modern-ui .app-footer-eyebrow,
body.modern-ui .footer-label {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

body.modern-ui .app-footer-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 320px;
}

body.modern-ui .app-footer-links > div {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(194, 28, 29, 0.04);
    border: 1px solid rgba(194, 28, 29, 0.08);
}

body.modern-ui .app-footer-links strong {
    color: var(--brand-black);
    font-size: 14px;
}


/* ============================================================================
 * 11. Vendor overrides (sweet-alert, datepicker)
 * ========================================================================= */

/* Datepicker */
body.modern-ui .dtp > .dtp-content {
    max-width: 330px;
    border-radius: 24px;
    border: 1px solid rgba(194, 28, 29, 0.18);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

body.modern-ui .dtp > .dtp-content > .dtp-date-view > header.dtp-header,
body.modern-ui .dtp div.dtp-date,
body.modern-ui .dtp div.dtp-time {
    background: linear-gradient(145deg, var(--brand-black), var(--brand-red));
    color: var(--brand-white);
}

body.modern-ui .dtp table.dtp-picker-days tr > td > a,
body.modern-ui .dtp .dtp-picker-time > a,
body.modern-ui .dtp .dtp-picker-month a {
    color: var(--brand-red-deep);
}

body.modern-ui .dtp table.dtp-picker-days tr > td > a.selected,
body.modern-ui .dtp .dtp-picker-time > a.selected,
body.modern-ui .dtp .dtp-picker-month a.selected {
    background: var(--brand-red);
    color: var(--brand-white);
}

body.modern-ui .dtp .dtp-buttons .btn,
body.modern-ui .dtp .p10 > a {
    color: var(--brand-red) !important;
    font-weight: 700;
}

/* Datepicker: accessibility fixes (see js/portal/datePickerA11y.js) */

/* Out-of-range days ship at #BDBDBD, which is 1.9:1 on white. */
body.modern-ui .dtp table.dtp-picker-days tr > td > span.dtp-select-day {
    color: #757575 !important;   /* 4.6:1 on white */
}

/* The overlay centres .dtp-content with inline left/margin-left/top written
   by the plugin _centerBox(), which runs only on open and on window resize,
   and caps it at max-height:520px with nothing scrollable. On a short or
   landscape viewport the calendar is clipped with no way to reach the OK
   button. Neutralise the inline positioning and let the backdrop scroll;
   margin:auto centres a flex child without clipping its overflow the way
   align-items:center does. :not(.hidden) so .dtp.hidden still wins. */
body.modern-ui .dtp:not(.hidden) {
    display: flex;
    overflow-y: auto;
    padding: 16px 0;
}

body.modern-ui .dtp > .dtp-content {
    left: auto !important;
    top: auto !important;
    margin: auto !important;
    max-height: none;
}

/* Keyboard focus has to be visible now that focus moves into the calendar. */
body.modern-ui .dtp a:focus-visible,
body.modern-ui .dtp button:focus-visible {
    outline: 3px solid #C21C1D;
    outline-offset: 2px;
}

/* ...but red on the red header is not, so invert it there. */
body.modern-ui .dtp > .dtp-content > .dtp-date-view > header.dtp-header a:focus-visible,
body.modern-ui .dtp div.dtp-date a:focus-visible {
    outline-color: #ffffff;
}

/* SweetAlert (legacy) — kept for any leftover SA1 modals */
body.modern-ui .sweet-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

body.modern-ui .sweet-alert {
    border-radius: 24px;
    border: 1px solid rgba(194, 28, 29, 0.16);
    box-shadow: var(--shadow-card);
}

body.modern-ui .sweet-alert h2 {
    color: var(--brand-black);
    font-weight: 800;
}

body.modern-ui .sweet-alert p {
    color: var(--text-secondary);
}

body.modern-ui .sweet-alert button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 22px;
    border-radius: var(--radius-pill);
    border: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

body.modern-ui .sweet-alert button.confirm {
    background: linear-gradient(145deg, var(--brand-red), var(--brand-red-deep)) !important;
    color: var(--brand-white) !important;
}

body.modern-ui .sweet-alert button.cancel {
    background: var(--brand-white) !important;
    color: var(--brand-black) !important;
    border: 1px solid var(--border-medium) !important;
}

body.modern-ui .sweet-alert .sa-icon.sa-success .sa-placeholder,
body.modern-ui .sweet-alert .sa-icon.sa-warning,
body.modern-ui .sweet-alert .sa-icon.sa-error,
body.modern-ui .sweet-alert .sa-icon.sa-info {
    border-color: var(--brand-red);
}

body.modern-ui .sweet-alert .sa-icon.sa-success .sa-line,
body.modern-ui .sweet-alert .sa-icon.sa-warning .sa-body,
body.modern-ui .sweet-alert .sa-icon.sa-warning .sa-dot,
body.modern-ui .sweet-alert .sa-icon.sa-error .sa-line,
body.modern-ui .sweet-alert .sa-icon.sa-info::before,
body.modern-ui .sweet-alert .sa-icon.sa-info::after {
    background-color: var(--brand-red);
}


/* ============================================================================
 * 12. Global plain-white surfaces (legacy compatibility)
 * ========================================================================= */

body.modern-ui .modern-page-shell,
body.modern-ui .verification-shell,
body.modern-ui .experience-panel,
body.modern-ui .detail-panel,
body.modern-ui .auth-card,
body.modern-ui .statement-hero,
body.modern-ui .statement-preview-card,
body.modern-ui .app-footer-card,
body.modern-ui .insight-card,
body.modern-ui .trust-card,
body.modern-ui .step-item,
body.modern-ui .metric-pill,
body.modern-ui .preview-empty-state,
body.modern-ui .statement-content,
body.modern-ui .timeout-activity-log,
body.modern-ui .modern-modal-body,
body.modern-ui .modern-modal-footer,
body.modern-ui .loader-modal-card {
    background: var(--brand-white);
}

body.modern-ui .experience-panel,
body.modern-ui .detail-panel,
body.modern-ui .auth-card,
body.modern-ui .statement-hero,
body.modern-ui .statement-preview-card,
body.modern-ui .app-footer-card,
body.modern-ui .insight-card,
body.modern-ui .trust-card,
body.modern-ui .step-item,
body.modern-ui .metric-pill,
body.modern-ui .preview-empty-state,
body.modern-ui .statement-content,
body.modern-ui .timeout-activity-log {
    border-color: rgba(17, 17, 17, 0.1);
}


/* ============================================================================
 * 13. Responsive
 * ----------------------------------------------------------------------------
 * Three breakpoints, in order of decreasing width:
 *   991px → tablet
 *   767px → mobile
 *   480px → small mobile
 * ========================================================================= */

/* ── Tablet (768–991px) ─────────────────────────────────────────── */

@media (max-width: 991px) {

    /* Navbar — brand stacks above nav */
    body.modern-ui .app-topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    body.modern-ui .app-brand {
        max-width: 100%;
    }

    body.modern-ui .app-nav-shell {
        justify-content: flex-start;
    }

    /* Layout — hero + footer stack vertically */
    body.modern-ui .statement-hero,
    body.modern-ui .app-footer-card {
        flex-direction: column;
        align-items: stretch;
    }

    /* Typography */
    body.modern-ui .experience-title {
        font-size: 34px;
    }

    /* Forms — single column */
    body.modern-ui .trust-grid,
    body.modern-ui .field-grid,
    body.modern-ui .statement-form-grid,
    body.modern-ui .detail-grid,
    body.modern-ui .insight-strip,
    body.modern-ui .app-footer-links {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile (<767px) ────────────────────────────────────────────── */

@media (max-width: 767px) {

    /* Container padding */
    body.modern-ui .container-fluid {
        padding-left: 14px;
        padding-right: 14px;
    }

    /* Navbar — compact 64px bar */
    body.modern-ui .app-topbar-inner {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        min-height: 64px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    body.modern-ui .app-brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.modern-ui .app-brand-logo-img {
        height: 36px;
    }

    body.modern-ui .app-brand-copy {
        display: none;
    }

    body.modern-ui .app-topbar-mobile-actions {
        display: inline-flex;
    }

    /* Nav shell becomes a slide-down panel */
    body.modern-ui .app-nav-shell {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1029;
        background: rgba(0, 0, 0, 0.96);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
        padding: 0 18px;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-layout), padding var(--transition-layout);
    }

    body.modern-ui .app-topbar.is-open .app-nav-shell {
        max-height: 320px;
        padding: 18px;
    }

    body.modern-ui .app-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    body.modern-ui .app-nav .top-nav-link {
        width: 100%;
        min-height: 48px;
        text-align: center;
        justify-content: center;
    }

    /* Hide chip and desktop sign-out form on mobile — the icon button
       in the mobile-actions row is the mobile path. */
    body.modern-ui .app-nav .top-nav-user-chip,
    body.modern-ui .app-nav .top-nav-signout-form {
        display: none;
    }

    /* Action rows stack */
    body.modern-ui .action-row,
    body.modern-ui .modern-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    body.modern-ui .btn-auth,
    body.modern-ui .btn-reset,
    body.modern-ui .btn-view,
    body.modern-ui .modern-modal-footer .btn {
        width: 100%;
        min-height: 48px;
        padding: 0 18px;
    }

    /* Panel padding tightening */
    body.modern-ui .experience-panel,
    body.modern-ui .detail-panel,
    body.modern-ui .auth-body,
    body.modern-ui .statement-preview-card,
    body.modern-ui .app-footer-card {
        padding: 22px;
    }

    body.modern-ui .experience-title {
        font-size: 28px;
    }

    body.modern-ui .card-section-title h2,
    body.modern-ui .otp-illustration h5 {
        font-size: 24px;
    }

    body.modern-ui .step-item {
        padding: 14px;
    }

    body.modern-ui .step-number {
        min-width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    body.modern-ui .field-card {
        padding: 16px;
    }

    body.modern-ui .processing-indicator {
        align-items: flex-start;
    }

    /* Account overview — strip stacks vertically */
    body.modern-ui .account-overview {
        padding: 22px;
    }

    body.modern-ui .account-overview__avatar {
        width: 48px;
        height: 48px;
        font-size: 15px;
    }

    body.modern-ui .account-overview__name {
        font-size: 22px;
    }

    body.modern-ui .account-overview__meta {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body.modern-ui .account-overview__meta-item {
        padding: 0;
        border-left: 0;
    }

    body.modern-ui .account-overview__meta-item + .account-overview__meta-item {
        padding-top: 14px;
        border-top: 1px solid var(--border-soft);
    }

    /* Cascade-safety button rules also need mobile sizing */
    body.modern-ui .btn.btn-auth,
    body.modern-ui .btn.btn-reset,
    body.modern-ui .btn.btn-view,
    body.modern-ui .modal-footer .btn-auth,
    body.modern-ui .modal-footer .btn-reset,
    body.modern-ui .modal-footer .btn-view,
    body.modern-ui .modern-modal-footer .btn-auth,
    body.modern-ui .modern-modal-footer .btn-reset,
    body.modern-ui .modern-modal-footer .btn-view {
        min-height: 48px;
        padding: 0 18px;
    }

    body.modern-ui .statement-viewer-modal-card {
        /* Bootstrap's .modal-fullscreen sets height: 100%, but the
           border-radius on .modern-modal-card adds a hard corner
           that looks odd on mobile. Drop it here. */
        border-radius: 0;
    }

    body.modern-ui .statement-viewer-frame-container {
        min-height: 0;
        flex: 1 1 auto;
    }

    body.modern-ui .statement-viewer-frame-container iframe,
    body.modern-ui .statement-viewer-frame-container embed,
    body.modern-ui .statement-viewer-frame-container object {
        height: 100%;
        min-height: 60vh;
    }

    /* Body grows to fill the modal so the loading state and viewer
       container can stretch. */
    body.modern-ui .statement-viewer-modal-card .modal-body {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        overflow: hidden;
    }
}

/* ── Small mobile (<480px) ──────────────────────────────────────── */

@media (max-width: 480px) {

    body.modern-ui .info-banner {
        gap: 10px;
        padding: 14px;
    }

    body.modern-ui .info-banner > i.material-icons {
        font-size: 20px;
    }

    body.modern-ui .info-banner strong {
        font-size: 14px;
    }

    body.modern-ui .info-banner p {
        font-size: 13px;
    }
}