@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700;900&family=Barlow+Condensed:wght@500;600&display=swap');

:root {
    --advanta-blue: #102D69;
    --advanta-green: #13A538;
    --light-blue: #1961AC;
    --dark-blue: #0C1C49;
    --light-green: #95C11F;
    --dark-green: #007A3E;
    --light-red: #E7344C;
    --ink: #1c2430;
    --muted: #5b6472;
}

* {
    box-sizing: border-box;
}

/* Belt-and-suspenders against horizontal scroll on mobile: full-bleed
   decorative elements (the brand circles below) are meant to be clipped by
   .auth-body's own overflow:hidden, but some mobile browsers still let the
   viewport itself scroll to reveal them unless overflow-x is also capped
   here, on the actual scrolling root. */
html {
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans', Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: #f2f4f7;
    color: var(--ink);
}

/* Auth screens (login): centered card over the brand's circle motif */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* The circle is the brand's main compositional graphic element */
.brand-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--light-blue), var(--dark-blue));
    z-index: 0;
}

.brand-circle--top {
    width: 640px;
    height: 640px;
    top: -320px;
    right: -220px;
}

.brand-circle--bottom {
    width: 420px;
    height: 420px;
    bottom: -260px;
    left: -180px;
    background: linear-gradient(135deg, var(--light-green), var(--dark-green));
    opacity: 0.9;
}

.brand-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(12, 28, 73, 0.18);
    width: 340px;
    max-width: calc(100vw - 2rem);
    padding: 2.25rem 2rem;
    text-align: center;
}

.brand-wordmark {
    font-family: 'Noto Sans', Arial, sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
    color: var(--advanta-blue);
    letter-spacing: 0.03em;
    margin: 0;
}

.brand-tagline {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--advanta-green);
    margin: 0.25rem 0 1.75rem;
}

.brand-form-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--ink);
    text-align: left;
}

.brand-form label {
    display: block;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.brand-form input[type=text],
.brand-form input[type=password],
.brand-form input[type=email],
.brand-form select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    margin-bottom: 1.1rem;
    border: 1px solid #d7dce3;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.15s ease;
}

.brand-form input[type=text]:focus,
.brand-form input[type=password]:focus,
.brand-form input[type=email]:focus,
.brand-form select:focus {
    outline: none;
    border-color: var(--light-blue);
    box-shadow: 0 0 0 3px rgba(25, 97, 172, 0.15);
}

.brand-button {
    display: inline-block;
    width: 100%;
    padding: 0.7rem;
    background: var(--advanta-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.brand-button:hover {
    background: var(--dark-green);
}

.brand-error {
    background: rgba(231, 52, 76, 0.08);
    color: var(--light-red);
    border: 1px solid rgba(231, 52, 76, 0.25);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1.1rem;
    text-align: left;
}

.brand-logout {
    display: inline-block;
    color: var(--advanta-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #d7dce3;
    border-radius: 6px;
    padding: 0.5rem 1.1rem;
}

.brand-logout:hover {
    border-color: var(--advanta-blue);
    background: rgba(16, 45, 105, 0.05);
}

/* App shell: sidebar with containers/modules + content area */
.app-body {
    display: flex;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    min-height: 100vh;
    background: var(--dark-blue);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.app-sidebar-top {
    flex-shrink: 0;
}

.app-sidebar-brand {
    display: block;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-weight: 900;
    font-size: 1.3rem;
    letter-spacing: 0.03em;
    padding: 0 1.5rem 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.app-sidebar-brand:hover {
    opacity: 0.85;
}

/* Hamburger toggle for the off-canvas nav — hidden on desktop, shown below
   the .app-sidebar-nav breakpoint. */
.app-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.app-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.app-sidebar-container {
    margin-bottom: 1.25rem;
}

.app-sidebar-container-label {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.55);
    padding: 0 1.5rem;
    margin-bottom: 0.4rem;
}

.app-sidebar-link {
    display: block;
    padding: 0.55rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border-left: 3px solid transparent;
}

.app-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.app-sidebar-link.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--light-green);
    color: #fff;
}

.app-sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.app-sidebar-user {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.app-logout-link {
    color: var(--light-green);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.app-content {
    flex: 1;
    padding: 2.5rem 3rem;
}

.app-page-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--advanta-blue);
    margin: 0 0 1.5rem;
}

.brand-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(12, 28, 73, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.brand-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(12, 28, 73, 0.06);
}

.brand-table th,
.brand-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eef0f3;
    font-size: 0.9rem;
    vertical-align: top;
}

.brand-table th {
    background: #f7f9fb;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.brand-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(19, 165, 56, 0.12);
    color: var(--dark-green);
}

.access-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.access-container {
    min-width: 180px;
}

.access-container-title {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
}

.access-module {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
    padding-left: 1.2rem;
    cursor: pointer;
}

/* Shared form layout helpers — flex rows that need to wrap gracefully on
   narrow screens instead of clipping or squeezing their contents. */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
}

.checkbox-label input[type=checkbox] {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* Wraps wide content (tables) so it scrolls within itself instead of
   forcing the whole page to scroll horizontally on narrow screens. */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.list-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Collapsible per-country sections on Account Statement Rules — native
   <details>/<summary> so it works with zero JS and stays keyboard/mobile
   friendly out of the box. */
.rules-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(12, 28, 73, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.rules-section-summary {
    list-style: none;
    cursor: pointer;
    padding: 1.1rem 1.5rem;
    font-weight: 700;
    color: var(--advanta-blue);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rules-section-summary::-webkit-details-marker {
    display: none;
}

.rules-section-summary::after {
    content: "+";
    font-size: 1.3rem;
    line-height: 1;
    color: var(--muted);
    transition: transform 0.15s;
}

.rules-section[open] > .rules-section-summary::after {
    content: "\2212";
}

.rules-section-body {
    padding: 0 1.5rem 1.5rem;
}

.rules-section-body .brand-panel {
    box-shadow: none;
    border: 1px solid #eef0f3;
}

.brand-muted {
    color: var(--muted);
    font-size: 0.85rem;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--advanta-blue);
    text-decoration: none;
}

button.icon-button {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.icon-button.danger:hover {
    background: rgba(231, 52, 76, 0.1);
    color: var(--light-red);
}

.icon-button:hover {
    background: rgba(16, 45, 105, 0.08);
}

/* ==========================================================================
   Responsive breakpoint — tablets and phones.

   Desktop styles above are the baseline (unchanged); everything below only
   applies at or under 768px, which is where the fixed 260px sidebar stops
   leaving enough room for content and touch targets need to grow.
   ========================================================================== */
@media (min-width: 769px) {
    .app-sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-body {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        min-height: auto;
        padding: 0;
    }

    .app-sidebar-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.85rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .app-sidebar-brand {
        padding: 0;
        margin-bottom: 0;
        border-bottom: none;
    }

    .app-sidebar-toggle {
        display: inline-flex;
    }

    .app-sidebar-nav {
        display: none;
        padding-top: 0.5rem;
    }

    .app-sidebar-nav.is-open {
        display: flex;
    }

    .app-sidebar-link {
        padding: 0.85rem 1.5rem;
    }

    .app-sidebar-footer {
        padding-bottom: 1rem;
    }

    .app-logout-link {
        display: inline-block;
        padding: 0.4rem 0;
    }

    .app-content {
        padding: 1.25rem 1rem;
    }

    .app-page-title {
        font-size: 1.3rem;
    }

    .brand-card {
        padding: 1.75rem 1.25rem;
    }

    .brand-panel {
        padding: 1.1rem;
    }

    .rules-section-summary {
        padding: 0.9rem 1.1rem;
    }

    .rules-section-body {
        padding: 0 1.1rem 1.1rem;
    }

    .brand-table th,
    .brand-table td {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }

    .icon-button {
        width: 44px;
        height: 44px;
    }

    .brand-logout {
        padding: 0.65rem 1.1rem;
    }

    .access-grid {
        gap: 1rem;
    }
}
