* { box-sizing: border-box; }

:root {
    --blue: var(--color-primary);
    --blue-dark: var(--color-primary-dark);
    --primary: var(--color-primary);
    --text-muted: var(--color-text-muted);
    /* Control borders must clear 3:1 (WCAG 1.4.11); see --color-border-control
       in tokens.css. Every use of --border here is an interactive control. */
    --border: var(--color-border-control, #868d96);
    --input-bg: #f8fafc;
    --white: var(--color-surface);
    --radius: var(--r);
}

/* ── Back link — text-and-arrow style so it reads as navigation, not a FAB ── */
.back-home {
    position: fixed;
    top: 1.6rem;
    left: 1.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem;
    color: #1d4ed8;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 9999px;
    font-size: 1.3rem;
    font-weight: 600;
    z-index: 100;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.back-home:hover {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    transform: translateX(-2px);
}
.back-home svg { flex-shrink: 0; }

/* ── Auth switch ── */
/* .back-home is position:fixed, so it leaves the flow and this paragraph —
   which follows it in the markup — renders underneath it. On narrow screens
   the centred text starts at ~x61 while the button reaches x158, so the fixed
   button covered the words "Already h". Clear the button's 5.3rem bottom edge
   on mobile; ≥768px there is room beside it and the original spacing returns. */
.auth-switch {
    font-size: 1.4rem;
    color: #6b7280;
    text-align: center;
    /* Now sits inside the card under the Next button, so the old 6.4rem top
       margin (which existed to clear .back-home when this floated above the
       card) would just push it away from the button it belongs to. */
    margin: 2rem 0 0;
    padding: 0 2rem;
}
.auth-switch a { color: var(--blue); font-weight: 600; text-decoration: underline; }

/* Server-side error banner shown when signup.php gets ?error=<code> */
.signup-error-banner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.6rem auto 0;
    padding: 1rem 1.4rem;
    max-width: 42rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.9rem;
    color: #991b1b;
    font-size: 1.3rem;
    line-height: 1.4;
}
.signup-error-banner svg { color: #dc2626; flex-shrink: 0; }
html[data-theme="dark"] .signup-error-banner {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.32);
    color: #fca5a5;
}

/* ── Body ── */
body {
    background: linear-gradient(160deg, #eff6ff 0%, #eff6ff 55%, #e0e7ff 100%);
    font-family: 'Poppins', Arial, sans-serif;
    margin: 0;
    /* Top padding clears the fixed .back-home chip, which is 16px from the top
       and 37px tall. Without it the card sat at y=16 and the chip crossed its
       left edge by 12px — the button was drawn on top of the card corner. */
    padding: 6.4rem 1.6rem;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    /* Was flex-start, which left the card at the top with ~200px of dead space
       under it. `safe center` centres it but degrades to flex-start when the
       step is taller than the viewport — plain `center` would push the top of
       a tall step above the scroll origin, where it cannot be reached. The
       unprefixed value is the fallback for browsers that do not parse `safe`. */
    justify-content: center;
    justify-content: safe center;
    align-items: center;
    gap: 0;
}

/* ── Headings ── */
h1 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--blue);
    text-align: center;
    margin: 0 0 0.4rem;
}

/* ── Step counter ── */
.step-counter {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    letter-spacing: 0.02em;
}

/* ── Phone/Email toggle navbar ── */
.navbar {
    position: relative;
    width: 100%;
    max-width: 36rem;
    height: 4.8rem;
    background: #f1f5f9;
    border: 1.5px solid var(--border);
    border-radius: 1.2rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    overflow: hidden;
}

button {
    background-color: transparent;
    border: none;
    font-size: 1.5rem;
    font-family: 'Poppins', Arial, sans-serif;
    cursor: pointer;
    padding: 0 2rem;
    border-radius: 1rem;
    width: 50%;
    color: #374151;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.phone_btn { color: #374151; }
.email_btn { color: royalblue; }

.active_btn {
    position: absolute;
    z-index: 0;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background-color: #fff;
    border-radius: calc(1.2rem - 4px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.slide { transform: translateX(100%); }

.contact-email { display: flex; }
.contact-phone { display: none; }

/* ── Form wrapper ── */
.form_submit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 1.6rem 1.6rem 6rem;
}

/* ── Form steps (card style) ── */
.step_1,
.step_2,
.basicinfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.6rem;
    width: 100%;
    max-width: 44rem;
    background: #fff;
    border-radius: 2rem;
    padding: 3.2rem 2.4rem;
    box-shadow: 0 4px 32px rgba(37, 99, 235, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.7);
}

.step_2 { display: none; }

/* ── Labels ── */
label {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 36rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: #374151;
}

.label_text {
    font-size: 1.4rem;
    font-weight: 500;
    color: #374151;
}

/* ── Inputs, selects, textarea ── */
input,
select,
textarea {
    border: 1.5px solid var(--border);
    width: 100%;
    height: 4.8rem;
    background: var(--input-bg);
    padding: 0 1.6rem;
    border-radius: 1.2rem;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 1.5rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

input::placeholder {
    color: #c0c9d6;
}

/* ── Prefixed fields (+961 phone, https:// website) ──
   A fixed, un-typeable prefix sits in a chip on the left; the user enters only
   the local number / domain and the prefix is prepended on submit. */
.prefixed-field {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 4.8rem;
    border: 1.5px solid var(--border);
    border-radius: 1.2rem;
    background: var(--input-bg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.prefixed-field:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}
.field-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 1.3rem;
    background: rgba(37, 99, 235, 0.08);
    color: var(--blue);
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    border-right: 1.5px solid var(--border);
    user-select: none;
}
.prefixed-field input {
    border: none !important;
    height: auto;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
}
html[data-theme="dark"] .prefixed-field {
    background: #0f172a;
    border-color: var(--color-border-control);
}
html[data-theme="dark"] .field-prefix {
    background: rgba(96, 165, 250, 0.14);
    color: #93c5fd;
    border-right-color: var(--color-border-control);
}

/* ── Registration document preview ──
   On upload the dashed dropzone shows the image (or a file chip for a PDF), so
   the organisation can see the file is attached before submitting. */
.doc-upload-preview {
    max-height: 8rem;
    max-width: 90%;
    border-radius: 0.8rem;
    object-fit: contain;
}
.doc-upload-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--blue);
    font-weight: 600;
    font-size: 1.2rem;
    text-align: center;
    word-break: break-all;
    padding: 0 0.8rem;
}
.image_container_file.has-file {
    border-style: solid;
    background: #eef4ff;
}
html[data-theme="dark"] .image_container_file.has-file {
    background: #111827;
}

input[type="button"],
input[type="submit"] {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    height: 5rem;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
input[type="button"]:hover,
input[type="submit"]:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
}
input[type="button"]:disabled,
input[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#role { background: var(--input-bg); }

textarea {
    padding: 1.2rem 1.6rem;
    height: auto;
    min-height: 9.6rem;
    resize: vertical;
}

select {
    appearance: none;
    background-image: url("../images/chevron-down.svg");
    background-color: var(--input-bg);
    background-repeat: no-repeat;
    background-size: 2rem;
    background-position: right 1.2rem center;
    padding-right: 3.6rem;
}

span { display: inline-block; }

/* ── Back button ── */
.back-btn {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(37, 99, 235, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    color: var(--blue);
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', Arial, sans-serif;
    align-self: flex-start;
    flex-shrink: 0;
    transition: background 0.2s, box-shadow 0.2s;
}
.back-btn:hover {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

/* ── Bio counter ── */
.bio-counter {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: right;
    width: 100%;
    max-width: 36rem;
    margin-top: -1rem;
}

/* ── Upload hint ── */
.upload-hint {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Profile upload ── */
.profile-upload-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0.4rem 0;
}

.profile-upload-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.image_circle {
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid var(--blue);
    background: #f1f5f9;
}

.image_circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit_text,
.file_text {
    color: var(--blue);
    font-size: 1.3rem;
    font-weight: 600;
}

/* ── Phone prefix + input grid ── */
.input-group {
    display: grid;
    width: 100%;
    max-width: 36rem;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
}

/* ── Organisation step (same card style as other steps) ── */
.organisation_role {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1.6rem;
    width: 100%;
    max-width: 44rem;
    background: #fff;
    border-radius: 2rem;
    padding: 3.2rem 2.4rem;
    box-shadow: 0 4px 32px rgba(37, 99, 235, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.7);
    margin-top: 0;
}

/* ── Org document upload ── */
.file_organisation_upload_container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.file_organisation_upload_label {
    width: 100%;
    max-width: 36rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.image_container_file {
    width: 100%;
    height: 10rem;
    border-radius: var(--radius);
    border: 2px dashed var(--blue);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    background: #f8faff;
    transition: background 0.2s, border-color 0.2s;
}
.image_container_file:hover { background: #eff6ff; border-color: var(--blue-dark); }

.image_container_file img {
    width: 4rem;
    height: 4rem;
    opacity: 0.6;
}

/* ── Gender selector ── */
.gender-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 36rem;
}

.gender-group .label_text { font-size: 1.4rem; }

/* Four options never fit one phone-width row. As a nowrap flex row the items
   could not shrink below their min-content width (flex items default to
   min-width:auto, and "Prefer" sets the floor), so the last box overflowed the
   card and "Prefer not to say" wrapped one word per line — stretching all four
   boxes to 144px tall. Grid with minmax(0, 1fr) lets the columns shrink;
   two per row here, four per row at ≥768px. */
.gender-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Tighter than the old 1rem because each row now carries its own 1.2rem
       of tap-target padding; the gap only has to separate the hit areas. */
    gap: 0.2rem 1.6rem;
    width: 100%;
}

.gender-option {
    /* flex-direction is set explicitly because the generic `label` rule near
       the top of this file is `display:flex; flex-direction:column`, and this
       is a <label>. Without the reset the dot stacked ABOVE its text and each
       option became a 175x77 tile — the "card" look was an accident, not a
       decision. */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
    cursor: pointer;
    /* No fill, no border: this is a radio, not a card. The vertical padding
       is not decoration — it is the tap target, taking the clickable row to
       44px (12 + 20px dot + 12) so it stays thumb-friendly on a phone even
       though the control now looks light. */
    padding: 1.2rem 0.2rem;
    background: none;
    border: 0;
    border-radius: 0;
    max-width: none;
    transition: color 0.2s;
}
.gender-option:hover .gender-pill { color: var(--blue); }

/* Visually hidden, NOT display:none. `display:none` drops a radio out of the
   tab order and the accessibility tree, which left this whole group
   unreachable by keyboard — there was no way to choose a gender without a
   mouse. This keeps it focusable and announced while staying invisible. */
.gender-option input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

/* The hidden input takes focus, so the visible dot has to show the ring. */
.gender-option input[type="radio"]:focus-visible ~ .gender-radio-circle {
    outline: 3px solid var(--color-primary-glow);
    outline-offset: 2px;
}

.gender-radio-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--color-border-control, #868d96);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.gender-radio-circle::after {
    content: '';
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--blue);
    transform: scale(0);
    transition: transform 0.2s;
}

.gender-option input[type="radio"]:checked ~ .gender-radio-circle { border-color: var(--blue); }
.gender-option input[type="radio"]:checked ~ .gender-radio-circle::after { transform: scale(1); }
.gender-option input[type="radio"]:checked ~ .gender-pill { color: var(--blue); font-weight: 600; }

.gender-pill {
    font-size: 1.5rem;
    color: #6b7280;
    transition: color 0.2s;
}

/* ── Step progress bar ── */
.step-progress-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
}

.sp-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background 0.25s, transform 0.25s;
}

.sp-dot.sp-done {
    background: var(--blue);
    opacity: 0.4;
}

.sp-dot.sp-active {
    background: var(--blue);
    width: 2.4rem;
    border-radius: 9999px;
}

/* ── Password strength bar ── */
.pwd-strength-wrap {
    width: 100%;
    max-width: 36rem;
    margin-top: -0.8rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pwd-strength-bar {
    display: flex;
    gap: 0.4rem;
    flex: 1;
}

.pwd-strength-bar span {
    flex: 1;
    height: 0.4rem;
    border-radius: 9999px;
    background: #e2e8f0;
    transition: background 0.3s;
}

.pwd-strength-label {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 7rem;
    text-align: right;
    white-space: nowrap;
    transition: color 0.3s;
}

/* ── Role cards — always visible (mobile + desktop) ── */
.role_cards { display: none; }

/* ── Role card small description text ── */
.image_card1 small,
.image_card2 small,
.image_card3 small {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
    text-align: left;
    line-height: 1.4;
}

/* Role name (mobile — side-by-side layout, left-aligned) */
.role_cards span:not(.step-counter):not(.sp-dot) {
    text-align: left;
}

/* ── Role cards — visible on all screen sizes when shown by JS ── */
.role_cards {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1.4rem;
    width: 100%;
    min-height: 100vh;
    padding: 5.6rem 2rem 4rem;
    position: relative;
}

/* Mobile: progress dots + counter + h1 flow naturally above the cards
   (desktop overrides re-apply absolute positioning further down) */
.role_cards .step-progress-bar {
    position: static;
    transform: none;
    margin-bottom: 0.4rem;
}

.role_cards .step-counter {
    position: static;
    transform: none;
    margin-bottom: 1.2rem;
    white-space: nowrap;
}

.role_cards h1 {
    position: static;
    transform: none;
    white-space: normal;
    font-size: 2rem;
    margin: 0 0 1.6rem;
    text-align: center;
    line-height: 1.2;
}

.back-from-roles {
    position: absolute;
    top: 1.6rem;
    left: 2rem;
    z-index: 2;
}

.image-card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 36rem;
    min-height: 8.4rem;
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.image-card-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.16);
    border-color: var(--blue);
}

.image_card1,
.image_card2,
.image_card3 {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    gap: 1.2rem;
    width: 100%;
    height: 100%;
    padding: 1.2rem 1.6rem;
}

/* Smaller, role-tinted icon tiles instead of huge raw SVGs */
.image_card1 img,
.image_card2 svg,
.image_card3 svg {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    flex-shrink: 0;
    padding: 0.8rem;
    border-radius: 50%;
    background: var(--color-primary-light);
    box-sizing: border-box;
}
.image_card1 img { background: #fee2e2; }
.image_card3 svg { background: #fef3c7; }

.image_card2 svg { fill: #2563eb; }
.image_card3 svg { fill: #f59e0b; }

.image-card-container:hover .image_card1 img,
.image-card-container:hover .image_card2 svg,
.image-card-container:hover .image_card3 svg { transform: scale(1.08); transition: transform 0.2s; }

.role_cards span:not(.step-counter):not(.sp-dot) {
    font-size: 1.6rem;
    font-weight: 600;
    color: #374151;
}

/* Card label + description column */
.image_card1 > div,
.image_card2 > div,
.image_card3 > div {
    display: flex;
    flex-direction: column;
}

/* Mobile keeps the original behavior — hide the desktop-only check badge and Continue button */
.card-check { display: none; }
.role-continue-btn { display: none; }

/* Mobile: grid wrapper just stacks cards (preserves original mobile layout) */
.role-cards-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    width: 100%;
}

/* ── Desktop (≥768px) ── */
@media (min-width: 768px) {

    body {
        background: linear-gradient(160deg, #eff6ff 0%, #eff6ff 55%, #e0e7ff 100%);
    }

    /* Stays two columns: .gender-group is capped at 36rem at every width, so
       four columns would be ~82px each and break "Prefer not to say" over four
       lines here too.
       No horizontal padding to restore now that the box is gone — indenting
       the dot would just push it out of line with the labels above it. The
       vertical padding is the tap target and is already set in the base rule. */

    /* Role card grid — side by side on desktop */
    .role_cards {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2.8rem;
        padding: 10rem 2rem 6rem;
    }

    /* Desktop: restore absolute positioning for the top header
       (mobile uses static flow above the cards). */
    .role_cards .step-progress-bar {
        position: absolute;
        top: 1.8rem;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0;
    }
    .role_cards .step-counter {
        position: absolute;
        top: 3.2rem;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0;
    }
    .role_cards h1 {
        position: absolute;
        top: 5.6rem;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        font-size: 3.2rem;
        margin: 0;
        text-align: center;
    }

    /* Per-role accent variables — set on the card itself */
    .image-card-container[data-role-color="rose"]  { --role-accent: #e11d48; --role-accent-2: #f43f5e; --role-deep: #be123c; --role-soft: rgba(225, 29, 72, 0.10); --role-glow: rgba(225, 29, 72, 0.36); --role-ring: rgba(225, 29, 72, 0.50); }
    .image-card-container[data-role-color="blue"]  { --role-accent: #2563eb; --role-accent-2: #3b82f6; --role-deep: #1d4ed8; --role-soft: rgba(37, 99, 235, 0.10); --role-glow: rgba(37, 99, 235, 0.36); --role-ring: rgba(37, 99, 235, 0.50); }
    .image-card-container[data-role-color="amber"] { --role-accent: #f59e0b; --role-accent-2: #fbbf24; --role-deep: #d97706; --role-soft: rgba(245, 158, 11, 0.12); --role-glow: rgba(245, 158, 11, 0.40); --role-ring: rgba(245, 158, 11, 0.55); }

    /* Larger hero-style cards */
    .image-card-container {
        width: 26rem;
        height: 38rem;
        flex-direction: column;
        max-width: 26rem;
        background: #fff;
        border: 1.5px solid rgba(226, 232, 240, 0.9);
        border-radius: 2.4rem;
        box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
        position: relative;
        overflow: hidden;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
                    box-shadow 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
                    border-color 0.2s;
    }

    /* Top hero area — colored gradient with icon */
    .image-card-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 14rem;
        background: linear-gradient(135deg, var(--role-accent) 0%, var(--role-accent-2) 100%);
        z-index: 0;
    }

    /* Decorative circles in the hero area */
    .image-card-container::after {
        content: '';
        position: absolute;
        top: -4rem;
        right: -4rem;
        width: 14rem;
        height: 14rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        pointer-events: none;
        z-index: 0;
    }

    /* Hover: card lift + stronger shadow + icon dance */
    .image-card-container:hover {
        transform: translateY(-12px) scale(1.03);
        box-shadow: 0 28px 60px var(--role-glow);
        border-color: var(--role-accent);
    }

    /* Inner card column */
    .image_card1,
    .image_card2,
    .image_card3 {
        flex-direction: column;
        gap: 1rem;
        padding: 0;
        justify-content: flex-start;
        position: relative;
        z-index: 1;
        width: 100%;
        height: 100%;
    }

    /* Icon: floats over the hero gradient, white tinted circle */
    .image_card1 img,
    .image_card2 svg,
    .image_card3 svg {
        width: 9.6rem;
        height: 9.6rem;
        padding: 2rem;
        border-radius: 50%;
        margin: 2.4rem auto 0;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
        transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
        position: relative;
        z-index: 2;
    }
    /* Make sure SVGs render in role accent on the white disc */
    .image_card2 svg { fill: var(--role-accent); }
    .image_card3 svg { fill: var(--role-accent); }

    .image-card-container:hover .image_card1 img,
    .image-card-container:hover .image_card2 svg,
    .image-card-container:hover .image_card3 svg {
        transform: scale(1.08) rotate(-4deg);
    }

    /* Role name — larger and bolder */
    .role_cards span:not(.step-counter):not(.sp-dot) {
        font-size: 2.2rem;
        font-weight: 800;
        color: #0f172a;
        letter-spacing: -0.02em;
        position: relative;
        z-index: 1;
        margin-top: 4.2rem;
        padding: 0 1.6rem;
    }

    /* Underline accent under the role name */
    .image_card1 > span:not(.step-counter):not(.sp-dot)::after,
    .image_card2 > span:not(.step-counter):not(.sp-dot)::after,
    .image_card3 > span:not(.step-counter):not(.sp-dot)::after {
        content: '';
        display: block;
        width: 2.8rem;
        height: 0.35rem;
        background: linear-gradient(90deg, var(--role-accent) 0%, var(--role-accent-2) 100%);
        border-radius: 9999px;
        margin: 0.8rem auto 0;
        transition: width 0.28s ease;
    }
    .image-card-container:hover .image_card1 > span:not(.step-counter):not(.sp-dot)::after,
    .image-card-container:hover .image_card2 > span:not(.step-counter):not(.sp-dot)::after,
    .image-card-container:hover .image_card3 > span:not(.step-counter):not(.sp-dot)::after,
    .image-card-container.selected .image_card1 > span:not(.step-counter):not(.sp-dot)::after,
    .image-card-container.selected .image_card2 > span:not(.step-counter):not(.sp-dot)::after,
    .image-card-container.selected .image_card3 > span:not(.step-counter):not(.sp-dot)::after {
        width: 6rem;
    }

    /* Role description */
    .image_card1 small,
    .image_card2 small,
    .image_card3 small {
        font-size: 1.35rem;
        line-height: 1.55;
        padding: 0 1.8rem;
        color: #475569;
        position: relative;
        z-index: 1;
        margin-top: 0.6rem;
    }

    /* Selected state — full coverage colored border + strong ring */
    .image-card-container.selected {
        border-color: var(--role-accent);
        border-width: 2.5px;
        box-shadow: 0 0 0 5px var(--role-ring), 0 28px 56px var(--role-glow);
        transform: translateY(-10px) scale(1.04);
    }
    .image-card-container.selected .image_card1 img,
    .image-card-container.selected .image_card2 svg,
    .image-card-container.selected .image_card3 svg {
        transform: scale(1.12);
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22), inset 0 0 0 3px rgba(255, 255, 255, 0.7);
    }

    /* Checkmark badge (top-right) */
    .card-check {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 1.2rem;
        right: 1.2rem;
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        background: var(--role-accent);
        color: #fff;
        box-shadow: 0 4px 12px var(--role-glow);
        opacity: 0;
        transform: scale(0.6);
        transition: opacity 0.2s, transform 0.2s;
        z-index: 3;
        pointer-events: none;
    }
    .card-check svg { width: 1.6rem; height: 1.6rem; }
    .image-card-container.selected .card-check {
        opacity: 1;
        transform: scale(1);
    }

    /* Continue button under the role cards */
    .role-continue-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-top: 1.6rem;
        height: 5rem;
        width: auto;
        min-width: 22rem;
        max-width: 26rem;
        align-self: center;
        padding: 0 3.2rem;
        background: var(--blue);
        color: #fff;
        border: none;
        border-radius: 9999px;
        font-family: 'Poppins', Arial, sans-serif;
        font-size: 1.5rem;
        font-weight: 600;
        cursor: pointer;
        opacity: 0.45;
        pointer-events: none;
        transform: translateY(4px);
        transition: opacity 0.25s, transform 0.25s, background 0.2s, box-shadow 0.2s;
    }
    .role-continue-btn:not(:disabled) {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .role-continue-btn:not(:disabled):hover {
        background: var(--blue-dark);
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.28);
        transform: translateY(-2px);
    }

    /* Cards laid out in a row, Continue button on the line below */
    .role_cards {
        flex-direction: column;
        gap: 2.4rem;
    }
    .role-cards-grid {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: stretch;
        gap: 2.8rem;
        width: 100%;
    }

    /* Form card on desktop — wider */
    .form_submit {
        padding: 4rem 2rem 6rem;
        min-height: 100vh;
        justify-content: center;
    }

    .step_1,
    .step_2,
    .basicinfo,
    .organisation_role {
        max-width: 52rem;
        padding: 4rem 4.8rem;
    }
}

/* ── Password show/hide toggle ── */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrap input {
    padding-right: 4.4rem;
    width: 100%;
}

.pwd-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    height: auto;
    width: auto;
    border-radius: 0;
    display: flex;
    align-items: center;
}

.pwd-toggle svg {
    stroke: #9ca3af;
    transition: stroke 0.15s;
}

.pwd-toggle:hover svg { stroke: #6b7280; }

/* ── Inline validation errors (injected by signup.js) ── */
.field-error {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    color: var(--color-danger);
    font-size: 1.1rem;
    line-height: 1.4;
}
.field-error--centered { text-align: center; }

/* ── Dark mode polish ── */
html[data-theme="dark"] body {
    background: linear-gradient(160deg, #071113 0%, #0f172a 50%, #0d2b2b 100%);
}

html[data-theme="dark"] .step_1,
html[data-theme="dark"] .basicinfo,
html[data-theme="dark"] .organisation_role,
html[data-theme="dark"] .image-card-container,
html[data-theme="dark"] .navbar {
    background: rgba(17, 24, 39, 0.94);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .active_btn {
    background: #0f172a;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.28);
}

html[data-theme="dark"] label,
html[data-theme="dark"] .label_text,
html[data-theme="dark"] .gender-pill,
html[data-theme="dark"] .role_cards span:not(.step-counter):not(.sp-dot) {
    color: #e5e7eb;
}

/* Every selector here is an interactive control or a control wrapper (the
   file dropzone is clickable), so they all take the control token. Was
   hardcoded #334155 = 1.72:1 on this field.
   .gender-option is deliberately NOT in this list any more: it no longer
   draws a box, so painting a dark fill and a border on it would put the card
   back in dark mode only. Its dot already uses the control token. */
/* The button/submit inputs (Next, Back, Create account) are <input> too, so
   this text-field rule was painting them #0f172a — the exact dark-mode page
   background — leaving only the label visible until hover repainted it. They
   are excluded here and keep their primary-blue fill. */
html[data-theme="dark"] input:not([type="submit"]):not([type="button"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .image_container_file {
    background: #0f172a;
    border-color: var(--color-border-control);
    color: #f8fafc;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    background: #111827;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] .back-home {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(96, 165, 250, 0.28);
    color: #bfdbfe;
}

/* The inactive Phone/Email method toggle used #374151 (near-black) text, which
   disappeared on the dark toggle. Lift it to a readable muted light. */
html[data-theme="dark"] .phone_btn { color: #cbd5e1; }



/* "(optional)" hint next to a label — lighter and smaller than the label so it
   reads as an aside rather than part of the field name. */
.field-optional {
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--text-muted);
    opacity: 0.85;
}
