/* =============================================================================
   OSP — Auth Layout CSS
   Full-screen split: Brand panel (diagonal) | Form panel
   LTR: Brand LEFT   | Form RIGHT
   RTL: Form LEFT    | Brand RIGHT   (natural RTL flex reversal — no order needed)
============================================================================= */

/* ----------------------------------------------------------------------------
   Reset & Base
---------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green:        #2E7D32;
    --green-mid:    #388E3C;
    --green-light:  #43A047;
    --gray-dark:    #455A64;
    --gray-mid:     #607D8B;
    --border:       #d8dce6;
    --text:         #1a1a1a;
    --muted:        #8a8fa8;
    --white:        #ffffff;
    --radius:       6px;
    --ease:         0.22s ease;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* body IS the full-screen layout */
body {
    display: flex;
}

/* ----------------------------------------------------------------------------
   Brand panel  (LTR: left side)
   Key geometry:
     - Element width = 45%  (this is roughly what's VISIBLE)
     - clip-path cuts the right edge diagonally from 100% → 86%
     - Logo centred with align-items:center — no padding tricks needed
---------------------------------------------------------------------------- */
.auth-brand {
    background: linear-gradient(
        148deg,
        var(--gray-dark)   0%,
        var(--gray-mid)    26%,
        var(--green)       60%,
        var(--green-light) 100%
    );

    /* Diagonal right edge: top at 100%, bottom at 86% of the panel element */
    clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);

    /* Element width ≈ visible width. No need to overshoot. */
    width: 45%;
    flex-shrink: 0;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Decorative blobs */
.auth-brand::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -80px;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    pointer-events: none;
}
.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -140px;
    right: 60px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(255,255,255,0.035);
    pointer-events: none;
}

/* SVG already contains icon + "o s p" + "owners services platform" */
.auth-brand-logo {
    width: clamp(200px, 28vw, 500px);
    max-width: 70%;            /* never wider than the visible clip zone */
    height: auto;
    position: relative;
    z-index: 2;
    filter: brightness(0) invert(1);
}

/* ----------------------------------------------------------------------------
   Form panel  (LTR: right side)
---------------------------------------------------------------------------- */
.auth-form-panel {
    flex: 1;                   /* takes all remaining width */
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px 11% 72px 11%;
    position: relative;
    overflow-y: auto;
}

/* Globe lang switcher */
.lang-switcher {
    position: absolute;
    top: 22px;
    right: 26px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--green);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
    transition: opacity var(--ease);
}
.lang-switcher:hover { opacity: 0.7; }
.lang-switcher svg  { width: 24px; height: 24px; }

/* Top back button */
.auth-top-back {
    position: absolute;
    top: 22px;
    left: 26px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: var(--green);
    border: 1.5px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ease);
    z-index: 10;
    text-decoration: none;
}

.auth-top-back:hover {
    border-color: var(--green);
    background: #f8fbf8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46,125,50,0.1);
}

.auth-top-back svg {
    width: 20px;
    height: 20px;
}
.auth-top-back__label {
    display: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

[dir="rtl"] .auth-top-back {
    left: auto;
    right: 26px;
}

[dir="rtl"] .auth-top-back svg {
    transform: scaleX(-1);
}

/* ----------------------------------------------------------------------------
   RTL  — brand on RIGHT, form on LEFT

   How it works:
     - `direction: rtl` on <html> reverses flex row main-axis direction
     - First DOM child (auth-brand) → appears on the RIGHT automatically
     - Second DOM child (auth-form-panel) → appears on the LEFT automatically
     - NO `order` properties needed — they would fight the natural reversal

   We only need to:
     1. Mirror the diagonal clip (left edge slopes, not right)
     2. Swap padding on the form panel
     3. Reposition the lang switcher
     4. Flip the eye toggle and back-arrow icons
---------------------------------------------------------------------------- */
[dir="rtl"] .auth-brand {
    /* Mirror: left edge slopes from 0% to 14% */
    clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
}

[dir="rtl"] .auth-form-panel {
    padding: 72px 6% 72px 8%;
}

[dir="rtl"] .lang-switcher {
    right: auto;
    left: 26px;
}

[dir="rtl"] .input-icon-end {
    right: auto;
    left: 12px;
}

[dir="rtl"] .form-control.has-icon {
    padding-right: 16px;
    padding-left: 44px;
}

[dir="rtl"] .check-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .back-link svg {
    transform: scaleX(-1);
}

/* ----------------------------------------------------------------------------
   Typography
---------------------------------------------------------------------------- */
.auth-title {
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 34px;
    line-height: 1.65;
}

/* ----------------------------------------------------------------------------
   Alerts
---------------------------------------------------------------------------- */
.alert {
    padding: 11px 15px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 18px;
    line-height: 1.5;
}
.alert-danger  { background: #fdecea; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }

/* ----------------------------------------------------------------------------
   Form
---------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 13px 16px;
    font-size: 14.5px;
    font-family: 'Inter', sans-serif;
    color: #333;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.form-control::placeholder { color: #c0c4cc; }
.form-control:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3.5px rgba(46,125,50,0.10);
}
.form-control.is-invalid { border-color: #e53935; }
.form-control.has-icon   { padding-right: 44px; }

.invalid-feedback {
    display: block;
    font-size: 12.5px;
    color: #e53935;
    margin-top: 5px;
}

/* Password / icon wrapper */
.input-wrapper {
    position: relative;
}
.input-icon-end {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color var(--ease);
    line-height: 1;
}
.input-icon-end:hover { color: var(--green); }
.input-icon-end svg  { width: 19px; height: 19px; }

/* ----------------------------------------------------------------------------
   Remember / Forgot row
---------------------------------------------------------------------------- */
.check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.custom-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    user-select: none;
}
.custom-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--green);
    cursor: pointer;
    flex-shrink: 0;
}

.forgot-link {
    font-size: 14px;
    color: var(--green);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.forgot-link:hover { text-decoration: underline; }

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--green);
    text-decoration: none;
    font-weight: 500;
    margin-top: 20px;
}
.back-link:hover { text-decoration: underline; }
.back-link svg { width: 15px; height: 15px; }

/* ----------------------------------------------------------------------------
   Primary button
---------------------------------------------------------------------------- */
.btn-osp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--green);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
    box-shadow: 0 4px 14px rgba(46,125,50,0.28);
}
.btn-osp:hover {
    background: var(--green-mid);
    box-shadow: 0 6px 20px rgba(46,125,50,0.36);
    transform: translateY(-1px);
}
.btn-osp:active  { transform: translateY(0); }
.btn-osp:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ----------------------------------------------------------------------------
   OTP inputs
---------------------------------------------------------------------------- */
.otp-inputs {
    display: flex;
    gap: 10px;
    margin: 22px 0;
}

.otp-inputs input {
    width: 56px;
    height: 62px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-family: 'Inter', sans-serif;
    color: #333;
    transition: border-color var(--ease), box-shadow var(--ease);
    flex-shrink: 0;
}
.otp-inputs input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3.5px rgba(46,125,50,0.10);
}
.otp-inputs input.is-invalid { border-color: #e53935; }

.otp-resend {
    font-size: 13.5px;
    color: var(--muted);
    margin-top: 6px;
}
.otp-resend a {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
}
.otp-resend a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------------------
   Success modal
---------------------------------------------------------------------------- */
.success-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.50);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.success-overlay.active { display: flex; }

.success-modal {
    background: var(--white);
    border-radius: 14px;
    padding: 52px 48px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22);
    animation: popIn 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes popIn {
    from { transform: scale(0.72); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.success-icon {
    width: 84px;
    height: 84px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border: 3px solid #a5d6a7;
}
.success-icon svg { width: 46px; height: 46px; color: var(--green); }

.success-modal h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.success-modal p {
    font-size: 14px;
    color: #777;
    margin-bottom: 28px;
    line-height: 1.65;
}

/* ----------------------------------------------------------------------------
   Spinner
---------------------------------------------------------------------------- */
.spinner {
    display: inline-block;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------------------
   Responsive — Tablet  (≤900px)
---------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .auth-brand {
        width: 44%;
        clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%);
    }
    [dir="rtl"] .auth-brand {
        clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%);
    }

    .auth-brand-logo { width: clamp(150px, 24vw, 260px); }

    .auth-form-panel { padding: 56px 7% 56px 5%; }
    [dir="rtl"] .auth-form-panel { padding: 56px 5% 56px 7%; }

    .auth-top-back {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        width: fit-content;
        min-width: 34px;
        height: 34px;
        border-radius: 999px;
        padding: 0 10px;
        gap: 5px;
        border-color: #cfe3d1;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 4px 12px rgba(20,69,41,0.08);
        backdrop-filter: blur(4px);
        margin-top: 14px;
        margin-bottom: 10px;
        float: left;
        clear: both;
    }
    [dir="rtl"] .auth-top-back {
        left: auto;
        right: auto;
        float: right;
    }
    .auth-top-back svg {
        width: 16px;
        height: 16px;
    }
    .auth-top-back__label {
        display: inline;
        font-size: 12px;
    }

    .auth-title {
        clear: both;
    }
}

/* ----------------------------------------------------------------------------
   Responsive — Mobile  (≤640px) — stacked vertically
---------------------------------------------------------------------------- */
@media (max-width: 640px) {
    html, body { overflow-y: auto; }

    body { flex-direction: column; }

    /* Both LTR and RTL: brand on top, form below */
    .auth-brand {
        clip-path: none !important;
        width: 100% !important;
        min-height: 250px;
        order: 1 !important;
        padding: 44px 32px;
    }
    [dir="rtl"] .auth-brand {
        clip-path: none !important;
        padding: 44px 32px;
    }

    .auth-brand-logo { width: clamp(130px, 42vw, 190px); max-width: 60%; }

    .auth-form-panel {
        order: 2 !important;
        flex: none;
        width: 100%;
        padding: 40px 8% 52px;
        overflow-y: visible;
    }
    [dir="rtl"] .auth-form-panel {
        padding: 40px 8% 52px;
    }

    .lang-switcher       { top: 16px; right: 16px; }
    [dir="rtl"] .lang-switcher { right: auto; left: 16px; }

    .auth-top-back {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        gap: 4px;
        margin-top: 18px;
        margin-bottom: 8px;
    }
    .auth-top-back__label {
        font-size: 11px;
    }

    .otp-inputs input    { width: 44px; height: 52px; font-size: 20px; }
}


/* =============================================================================
   Select Community  (sc-*)
   Matches design: card list with thumbnail, name, meta, right-arrow
============================================================================= */

/* ---- Toolbar (search + sort) ---- */
.sc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    max-width: 440px;
}

.sc-search-wrap {
    flex: 1;
    position: relative;
}
.sc-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #aab;
    pointer-events: none;
}
[dir="rtl"] .sc-search-icon {
    left: auto;
    right: 12px;
}

.sc-search-input {
    display: block;
    width: 100%;
    padding: 10px 12px 10px 36px;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    color: #333;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
}
[dir="rtl"] .sc-search-input {
    padding: 10px 36px 10px 12px;
}
.sc-search-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.10);
}
.sc-search-input::placeholder { color: #c0c4cc; }

.sc-sort-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-mid);
    transition: border-color var(--ease), color var(--ease);
}
.sc-sort-btn:hover { border-color: var(--green); color: var(--green); }
.sc-sort-btn svg { width: 18px; height: 18px; }
.sc-sort-btn--desc { color: var(--green); border-color: var(--green); }

/* ---- Scrollable list ---- */
.sc-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 300px); /* Dynamic height instead of fixed 500px */
    min-height: 300px;
    max-width: 440px;
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
[dir="rtl"] .sc-list {
    padding-right: 0;
    padding-left: 6px;
}

/* ---- Community card ---- */
.sc-new-card {
    position: relative;
    height: 180px; /* Big height */
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    flex-shrink: 0; /* Important so cards don't shrink vertically */
}

.sc-new-card:hover, .sc-new-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.sc-new-card--selected {
    border-color: var(--green);
    box-shadow: 0 8px 20px rgba(46,125,50,0.2);
}

.sc-new-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transition: transform 0.4s ease;
}
.sc-new-card:hover .sc-new-card-bg {
    transform: scale(1.05); /* Slight zoom on hover */
}

.sc-new-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 65%, rgba(0,0,0,0.1) 100%);
    z-index: 2;
}

.sc-new-card-code {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
[dir="rtl"] .sc-new-card-code {
    right: auto;
    left: 12px;
}

.sc-new-card-content {
    position: absolute;
    bottom: 16px;
    left: 20px;
    right: 20px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sc-new-card-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.sc-new-card-loc {
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sc-new-card-loc svg {
    width: 14px;
    height: 14px;
}

/* Check icon when selected */
.sc-new-card-check {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 4;
    width: 32px;
    height: 32px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
[dir="rtl"] .sc-new-card-check {
    right: auto;
    left: 14px;
}
.sc-new-card-check svg {
    width: 16px;
    height: 16px;
}

.sc-new-card--selected .sc-new-card-check {
    opacity: 1;
    transform: scale(1);
}

/* ---- State boxes ---- */
.sc-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
}

.sc-state-msg {
    font-size: 14px;
    color: var(--muted);
}
.sc-state-msg--err   { color: #c62828; }
.sc-state-msg--muted { color: var(--muted); }

.sc-error-icon {
    width: 64px;
    height: 64px;
    background: #fff3e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e65100;
}
.sc-error-icon svg { width: 32px; height: 32px; }

/* Mini spinner */
.sc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(46,125,50,0.18);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* Outline button */
.btn-osp-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    color: var(--green);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid var(--green);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--ease), color var(--ease);
}
.btn-osp-outline:hover {
    background: var(--green);
    color: var(--white);
}
.btn-sm { padding: 8px 16px; font-size: 13.5px; }

/* Logout / back link at bottom */
.sc-logout-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    transition: color var(--ease);
}
.sc-logout-link:hover { color: var(--green); }

/* =============================================================================
   Select Role  (sr-*)
   Extends layouts.auth → column-stacked: banner on top, content below
============================================================================= */

/* ---- Community image banner ---- */
.sr-banner {
    position: relative;
    width: 100%;
    height: 280px;
    background: #c8e6c9 center/cover no-repeat;
    flex-shrink: 0;
    overflow: hidden;
}
/* Subtle dark gradient at the bottom – gives depth */
.sr-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.25) 100%);
    pointer-events: none;
}

/* ---- Content body ---- */
.sr-body {
    width: 100%;
    background: #fff;
    padding: 32px 40px 48px;
    box-sizing: border-box;
}

/* ---- Back button + community name row ---- */
.sr-top-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.sr-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f2f2f2;
    color: #333;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.18s ease;
}
.sr-back-btn:hover { background: #e4e4e4; color: #000; transform: scale(1.08); }
.sr-back-btn svg   { width: 18px; height: 18px; }

.sr-community-heading {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

/* ---- Meta row: subtitle (left) + code (right) ---- */
.sr-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.sr-subtitle       { font-size: 13.5px; color: #999; line-height: 1.5; }
.sr-community-code { font-size: 12.5px; font-weight: 700; color: #666; letter-spacing: 1px; text-transform: uppercase; }

/* ---- Section row: "Select Role" (left) + city (right) ---- */
.sr-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.sr-section-title { font-size: 17px; font-weight: 700; color: #1a1a1a; margin: 0; }
.sr-city          { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #888; }
.sr-city svg      { width: 14px; height: 14px; flex-shrink: 0; color: #aaa; }

/* ---- Role tiles grid ---- */
.sr-roles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 36px;
}

/* ---- Individual role tile ---- */
.sr-role-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 220px;
    min-height: 175px;
    background: #f9f9f9;
    border: 1.5px solid #e8e8e8;
    border-radius: 16px;
    cursor: pointer;
    outline: none;
    user-select: none;
    padding: 28px 20px;
    box-sizing: border-box;
    transition:
        border-color  0.2s ease,
        box-shadow    0.2s ease,
        background    0.2s ease,
        transform     0.15s ease;
}
.sr-role-tile:hover {
    border-color: #c8c8c8;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.sr-role-tile:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.22);
    border-color: var(--green);
}
.sr-role-tile--selected {
    background: #fff;
    border-color: #d5d5d5;
    box-shadow: 0 10px 36px rgba(0,0,0,0.14);
    transform: translateY(-2px);
}

/* Person / user icon */
.sr-role-icon {
    width: 64px;
    height: 64px;
    color: #606060;
    flex-shrink: 0;
    transition: color 0.18s ease;
}
.sr-role-tile:hover .sr-role-icon     { color: #333; }
.sr-role-tile--selected .sr-role-icon { color: #222; }

/* Role label */
.sr-role-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c2c2c;
    text-align: center;
    line-height: 1.45;
    letter-spacing: -0.1px;
}

/* ---- Footer: Start button ---- */
.sr-footer-row {
    display: flex;
    justify-content: flex-end;
}
.sr-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 340px;
    padding: 16px 40px;
    background: var(--green);
    color: var(--white);
    font-size: 15.5px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.2px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
    box-shadow: 0 4px 16px rgba(46,125,50,0.30);
}
.sr-start-btn:hover {
    background: var(--green-mid);
    box-shadow: 0 6px 24px rgba(46,125,50,0.40);
    transform: translateY(-1px);
}
.sr-start-btn:active   { transform: translateY(0); }
.sr-start-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- State boxes (loading / empty / error) ---- */
.sr-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 56px 24px;
    text-align: center;
}
.sr-state-msg { font-size: 14px; color: var(--muted); }
.sr-state-err { color: #c62828; }

/* Loading spinner */
.sr-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(46,125,50,0.15);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* Submit spinner (inside button) */
.sr-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.40);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ---- RTL flips ---- */
[dir="rtl"] .sr-back-btn svg { transform: scaleX(-1); }
[dir="rtl"] .sr-city         { flex-direction: row-reverse; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .sc-list   { max-height: 320px; }
    .sr-banner { height: 220px; }
    .sr-body   { padding: 28px 28px 40px; }
    .sr-role-tile { width: 180px; min-height: 155px; }
}
@media (max-width: 640px) {
    .sc-list       { max-height: none; }
    .sc-card-thumb { width: 60px; height: 46px; }
    .sr-banner     { height: 180px; }
    .sr-body       { padding: 24px 20px 36px; }
    .sr-roles-grid { gap: 12px; }
    .sr-role-tile  { width: calc(50% - 6px); min-height: 140px; padding: 22px 14px; }
    .sr-role-icon  { width: 52px; height: 52px; }
    .sr-start-btn  { min-width: 0; width: 100%; }
    .sr-footer-row { justify-content: stretch; }
}


/* ---- Community banner ---- */
.sr-banner {
    width: 100%;
    height: 260px;
    background: #c8e6c9 center/cover no-repeat;
    display: block;
}

/* ---- White content body below banner ---- */
.sr-body {
    width: 100%;
    background: #fff;
    padding: 28px 32px 40px;
    box-sizing: border-box;
}

/* ---- Top row: back + community name ---- */
.sr-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sr-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.18s ease;
}
.sr-back-btn:hover { background: #e0e0e0; color: #111; }
.sr-back-btn svg   { width: 18px; height: 18px; }

.sr-community-heading {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

/* ---- Meta row (subtitle left, code right) ---- */
.sr-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
}
.sr-subtitle       { font-size: 13.5px; color: #888; }
.sr-community-code { font-size: 13px; font-weight: 600; color: #555; letter-spacing: 0.5px; }

/* ---- Section header row (title left, city right) ---- */
.sr-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.sr-section-title { font-size: 16px; font-weight: 700; color: #1a1a1a; margin: 0; }
.sr-city          { font-size: 13px; color: #888; }
.sr-city svg      { display: inline-block; vertical-align: middle; width: 14px; height: 14px; margin-right: 3px; color: #888; }

/* ---- Role tiles grid ---- */
.sr-roles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 30px;
}

.sr-role-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 150px;
    min-height: 140px;
    background: #fafafa;
    border: 1.5px solid #e8e8e8;
    border-radius: 14px;
    cursor: pointer;
    outline: none;
    user-select: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    padding: 20px 16px;
}
.sr-role-tile:hover {
    border-color: #bbb;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.sr-role-tile:focus-visible {
    box-shadow: 0 0 0 3px rgba(46,125,50,0.18);
    border-color: var(--green);
}
.sr-role-tile--selected {
    background: #fff;
    border-color: #d0d0d0;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}

.sr-role-icon { width: 52px; height: 52px; color: #555; }
.sr-role-tile--selected .sr-role-icon { color: #333; }

.sr-role-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.4;
}

/* ---- Footer: Start button ---- */
.sr-footer-row {
    display: flex;
    justify-content: flex-end;
}
.sr-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 320px;
    padding: 15px 32px;
    background: var(--green);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
    box-shadow: 0 4px 14px rgba(46,125,50,0.28);
}
.sr-start-btn:hover    { background: var(--green-mid); box-shadow: 0 6px 20px rgba(46,125,50,0.36); transform: translateY(-1px); }
.sr-start-btn:active   { transform: translateY(0); }
.sr-start-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- State boxes ---- */
.sr-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 20px;
    text-align: center;
}
.sr-state-msg { font-size: 14px; color: var(--muted); }
.sr-state-err { color: #c62828; }

.sr-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(46,125,50,0.18);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
.sr-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.40);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ---- RTL ---- */
[dir="rtl"] .sr-back-btn svg { transform: scaleX(-1); }
[dir="rtl"] .sr-city svg     { margin-right: 0; margin-left: 3px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .sc-list   { max-height: 320px; }
    .sr-banner { height: 200px; }
}
@media (max-width: 640px) {
    .sc-list         { max-height: none; }
    .sc-card-thumb   { width: 60px; height: 46px; }
    .sr-body         { padding: 20px 16px 32px; }
    .sr-banner       { height: 160px; }
    .sr-roles-grid   { gap: 10px; }
    .sr-role-tile    { width: calc(50% - 5px); }
    .sr-start-btn    { min-width: 0; width: 100%; }
    .sr-footer-row   { justify-content: stretch; }
}

/* ---- Responsive adjustments ---- */
@media (max-width: 900px) {
    .sc-list  { max-height: 320px; }
    .select-role-list  { max-height: 260px; }
}
@media (max-width: 640px) {
    .sc-list  { max-height: none; }
    .select-role-list  { max-height: none; }
    .sc-card-thumb { width: 60px; height: 46px; }
}

/* =============================================================================
   Select Role V2 (srr-*)
   Scoped to select-role page via #srr-banner / .srr-page
============================================================================= */

    #srr-banner.auth-brand {
        position: relative;
        filter: saturate(1.1) contrast(1.05);
    }

    .srr-page {
        width: 100%;
        max-width: none;
        margin: 0 auto;
        min-height: 100%;
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: clamp(14px, 2.4vw, 24px) 0;
    }

    body:has(#srr-banner) .auth-form-panel {
        justify-content: flex-start;
        min-height: 100vh;
        overflow: hidden;
        padding-left: clamp(20px, 2.8vw, 34px);
        padding-right: clamp(20px, 2.8vw, 34px);
    }

    [dir="rtl"] body:has(#srr-banner) .auth-form-panel {
        justify-content: flex-start;
        min-height: 100vh;
        overflow: hidden;
        padding-left: clamp(20px, 2.8vw, 34px);
        padding-right: clamp(20px, 2.8vw, 34px);
    }

    .srr-hero {
        border: 1px solid #e7ebe7;
        border-radius: 28px;
        background:
            radial-gradient(circle at 100% 0, rgba(35, 106, 68, 0.1), transparent 48%),
            linear-gradient(140deg, #ffffff 0%, #f8fbf8 100%);
        padding: clamp(14px, 2.2vw, 24px);
        box-shadow: 0 22px 50px rgba(19, 41, 31, 0.08);
        animation: srrRise 0.4s ease both;
    }

    .srr-heading-row {
        display: flex;
        align-items: flex-start;
        gap: 14px;
    }

    .srr-back {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        color: #1f5f3d;
        border: 1px solid #d3e3d8;
        background: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
        flex-shrink: 0;
    }

    .srr-back:hover,
    .srr-back:focus-visible {
        transform: translateY(-1px);
        border-color: #61a17f;
        box-shadow: 0 10px 24px rgba(19, 41, 31, 0.14);
        outline: none;
    }

    .srr-back svg {
        width: 20px;
        height: 20px;
    }

    .srr-head-copy {
        min-width: 0;
    }

    .srr-eyebrow {
        font-size: 11px;
        letter-spacing: .16em;
        text-transform: uppercase;
        font-weight: 700;
        color: #2c7f51;
        margin-bottom: 10px;
    }

    .srr-title {
        font-size: clamp(26px, 3.2vw, 40px);
        line-height: 1.05;
        letter-spacing: -0.03em;
        font-weight: 800;
        color: #0e1712;
        margin: 0;
        word-break: break-word;
    }

    .srr-subtitle {
        margin-top: 8px;
        color: #4f5e54;
        font-size: clamp(13px, 1.1vw, 16px);
        line-height: 1.45;
    }

    .srr-context {
        margin-top: 12px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .srr-code,
    .srr-city {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-radius: 999px;
        border: 1px solid #d6e6dc;
        background: #fff;
        color: #2f4739;
        font-size: 12px;
        letter-spacing: .1em;
        text-transform: uppercase;
        font-weight: 700;
    }

    .srr-city:empty {
        display: none;
    }

    .srr-city svg {
        width: 14px;
        height: 14px;
    }

    .srr-panel {
        border-radius: 28px;
        border: 1px solid #e7ebe7;
        background: #ffffff;
        box-shadow: 0 26px 56px rgba(19, 41, 31, 0.06);
        overflow: hidden;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        animation: srrRise 0.5s ease both;
        animation-delay: .06s;
    }

    .srr-states {
        padding: clamp(16px, 2vw, 24px);
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .srr-state-box {
        min-height: 250px;
        display: grid;
        place-content: center;
        justify-items: center;
        gap: 14px;
        text-align: center;
    }

    .srr-state-msg {
        color: #47544b;
        font-size: 15px;
    }

    .srr-state-msg--err {
        color: #9f2f2f;
    }

    .srr-spinner {
        width: 36px;
        height: 36px;
        border-radius: 999px;
        border: 3px solid #d5e6dc;
        border-top-color: #2f8d58;
        animation: srrSpin .8s linear infinite;
    }

    .srr-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    #srr-content {
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .srr-card {
        position: relative;
        border: 1px solid #dce7df;
        border-radius: 20px;
        background:
            linear-gradient(170deg, rgba(255, 255, 255, 1) 0%, rgba(245, 251, 247, 1) 100%);
        min-height: 160px;
        padding: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        cursor: pointer;
        transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
        isolation: isolate;
    }

    .srr-card:hover {
        transform: translateY(-2px);
        border-color: #7ab692;
        box-shadow: 0 18px 32px rgba(20, 67, 43, 0.12);
    }

    .srr-card:focus-visible {
        outline: none;
        border-color: #3d8d61;
        box-shadow: 0 0 0 4px rgba(44, 127, 81, 0.22);
    }

    .srr-card--selected {
        border-color: #2d7d51;
        box-shadow: 0 14px 32px rgba(24, 74, 48, 0.18);
    }

    .srr-card--selected::before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        border: 2px solid rgba(45, 125, 81, 0.46);
        pointer-events: none;
    }

    .srr-icon-wrap {
        width: 88px;
        height: 88px;
        border-radius: 18px;
        background:
            linear-gradient(150deg, #f9fbfa 0%, #eef8f1 100%);
        border: 1px solid #e2ece4;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #2c7f51;
    }

    .srr-icon {
        width: 42px;
        height: 42px;
    }

    .srr-icon-png {
        width: 62px;
        height: 62px;
        object-fit: contain;
    }

    .srr-card-meta {
        text-align: center;
        display: grid;
        gap: 4px;
    }

    .srr-label {
        color: #16221b;
        font-size: clamp(18px, 1.5vw, 26px);
        letter-spacing: -0.025em;
        font-weight: 800;
        line-height: 1.1;
    }

    .srr-role-key {
        color: #5f6f64;
        font-size: 11px;
        letter-spacing: .14em;
        text-transform: uppercase;
        font-weight: 700;
    }

    .srr-check {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 26px;
        height: 26px;
        border-radius: 999px;
        background: #ffffff;
        border: 1px solid #ccddd2;
        color: #ffffff;
        display: grid;
        place-items: center;
        transition: background .2s ease, border-color .2s ease, color .2s ease;
    }

    .srr-check svg {
        width: 14px;
        height: 14px;
    }

    .srr-card--selected .srr-check {
        background: #2d7d51;
        border-color: #2d7d51;
        color: #ffffff;
    }

    .srr-footer {
        margin-top: auto;
        padding-top: 14px;
        border-top: 1px solid #ebf0ec;
        display: flex;
        justify-content: flex-end;
        background: #ffffff;
        position: sticky;
        bottom: 0;
        z-index: 3;
    }

    .srr-start {
        min-width: 210px;
        height: 50px;
        border-radius: 14px;
        border: 0;
        color: #ffffff;
        font-size: 24px;
        font-weight: 700;
        letter-spacing: -0.01em;
        background: linear-gradient(135deg, #2b7a4f 0%, #43a169 100%);
        box-shadow: 0 14px 26px rgba(18, 63, 40, 0.22);
        transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    }

    .srr-start:hover {
        transform: translateY(-1px);
        box-shadow: 0 18px 28px rgba(18, 63, 40, 0.24);
    }

    .srr-start:disabled {
        opacity: .52;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .srr-btn-spinner {
        width: 18px;
        height: 18px;
        border-radius: 999px;
        border: 2px solid rgba(255, 255, 255, 0.32);
        border-top-color: #ffffff;
        animation: srrSpin .7s linear infinite;
    }

    [dir="rtl"] .srr-back svg {
        transform: scaleX(-1);
    }

    @keyframes srrRise {
        from {
            transform: translateY(8px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes srrSpin {
        to { transform: rotate(360deg); }
    }

    @media (max-width: 1280px) {
        .srr-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 980px) {
        body:has(#srr-banner) .auth-form-panel,
        [dir="rtl"] body:has(#srr-banner) .auth-form-panel {
            overflow-y: auto;
        }

        .srr-page {
            min-height: auto;
        }

        .srr-panel {
            min-height: auto;
        }

        .srr-states {
            height: auto;
        }

        #srr-content {
            height: auto;
        }

        .srr-grid {
            grid-template-columns: 1fr;
        }

        .srr-label {
            font-size: clamp(18px, 4.4vw, 28px);
        }
    }

    @media (max-width: 640px) {
        .srr-page {
            width: 100%;
            gap: 12px;
            padding-top: 12px;
        }

        body:has(#srr-banner) .auth-form-panel,
        [dir="rtl"] body:has(#srr-banner) .auth-form-panel {
            padding-left: 16px;
            padding-right: 16px;
            overflow-y: auto;
        }

        .srr-hero,
        .srr-panel {
            border-radius: 20px;
        }

        .srr-state-box {
            min-height: 220px;
        }

        .srr-card {
            min-height: 160px;
            padding: 14px;
        }

        .srr-icon-wrap {
            width: 92px;
            height: 92px;
        }

        .srr-icon-png {
            width: 66px;
            height: 66px;
        }

        .srr-footer {
            justify-content: stretch;
        }

        .srr-start {
            width: 100%;
            min-width: 0;
            height: 50px;
            font-size: 26px;
        }
    }
