/* ============================================================
   Lilla Koll — Login page
   Font: Nunito (Google Fonts)
   Palette: Jämtland blue — deep sky blue gradient, white card
   ============================================================ */

:root {
    --grad-a: #1a5fa8;        /* Jämtland blue */
    --grad-b: #1e7ec4;        /* mid blue */
    --grad-c: #2d9ed4;        /* sky blue */
    --accent:  #2470c0;
    --accent-h: #1a5fa8;
    --card:    #ffffff;
    --text-1:  #0a2d52;       /* deep navy for headings */
    --text-2:  #4b5563;       /* medium grey for body */
    --text-3:  #9ca3af;       /* light grey for placeholders */
    --border:  #e5e7eb;
    --border-f: #2470c0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-card: 0 32px 80px rgba(26, 95, 168, 0.22),
                   0  8px 24px rgba(0,0,0,.12);
    --radius-card: 24px;
    --radius-input: 12px;
    --radius-btn:   14px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── Body / background ── */
body {
    font-family: 'Nunito', system-ui, sans-serif;
    min-height: 100vh;
    background: linear-gradient(145deg, var(--grad-a) 0%, var(--grad-b) 50%, var(--grad-c) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow-x: hidden;
}

/* ── Decorative background ── */
.bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Subtle dot grid overlay */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Floating blurred bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    filter: blur(2px);
    animation: drift linear infinite;
}
.bubble-1 { width: 340px; height: 340px; top: -12%; left: -8%;  animation-duration: 22s; }
.bubble-2 { width: 220px; height: 220px; top: 55%;  right: -6%; animation-duration: 28s; animation-delay: -8s; }
.bubble-3 { width: 160px; height: 160px; top: 25%;  left: 72%;  animation-duration: 20s; animation-delay: -12s; }
.bubble-4 { width: 440px; height: 440px; bottom: -18%; left: 25%; animation-duration: 35s; animation-delay: -18s; }
.bubble-5 { width: 110px; height: 110px; top: 8%;   right: 22%; animation-duration: 17s; animation-delay: -5s; }

@keyframes drift {
    0%   { transform: translateY(0px)  rotate(0deg); }
    33%  { transform: translateY(-24px) rotate(4deg); }
    66%  { transform: translateY(12px)  rotate(-4deg); }
    100% { transform: translateY(0px)  rotate(0deg); }
}

/* ── Language switcher ── */
.lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
    animation: lang-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

@keyframes lang-appear {
    from { opacity: 0; transform: translateY(-8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.lang-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 40px;
    padding: 7px 14px 7px 10px;
    color: white;
    cursor: pointer;
    transition:
        background  200ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow  200ms cubic-bezier(0.4, 0, 0.2, 1),
        transform   150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-inner:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.lang-inner:active {
    transform: translateY(0) scale(0.98);
    background: rgba(255,255,255,0.22);
    box-shadow: none;
}

.lang-icon {
    width: 16px;
    height: 16px;
    color: white;
    flex-shrink: 0;
}

.lang-chevron {
    width: 10px;
    height: 10px;
    color: rgba(255,255,255,0.8);
    flex-shrink: 0;
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chevron roterar 180° när menyn är öppen */
.lang-trigger[aria-expanded="true"] .lang-chevron {
    transform: rotate(180deg);
}

/* Visningsnamn på valt språk */
.lang-label {
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

/* ── Dropdown-lista ─────────────────────────────────────────────────
   Absolut-positionerad relativt .lang-switcher (position: fixed),
   öppnar sig nedåt med scale+opacity-animation.
   Glaseffekt matchar .lang-inner exakt: samma bakgrund, blur och
   kantfärg. Ingen saturate — saturate(2) skulle förstärka
   bakgrundsgradienten och ge ett oönskat mättat blåskimmer.
   ─────────────────────────────────────────────────────────────────── */
.lang-listbox {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 144px;
    list-style: none;
    margin: 0;
    padding: 6px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);  /* = .lang-inner */
    backdrop-filter: blur(12px);             /* = .lang-inner — ingen saturate */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.28);  /* = .lang-inner */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.22),
        0 2px 8px  rgba(0, 0, 0, 0.14);
    z-index: 100;

    /* Stängt läge */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.94) translateY(-6px);
    transform-origin: top right;
    transition:
        opacity    180ms cubic-bezier(0.4, 0, 0.2, 1),
        transform  180ms cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 180ms;
}

/* Öppet läge — läggs till av JS */
.lang-listbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1) translateY(0);
    transition:
        opacity    180ms cubic-bezier(0.34, 1.10, 0.64, 1),
        transform  200ms cubic-bezier(0.34, 1.10, 0.64, 1),
        visibility 0s linear 0s;
}

/* Enskilt alternativ */
.lang-option {
    display: block;
    padding: 8px 13px;
    border-radius: 10px;
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    user-select: none;
    outline: none;
    white-space: nowrap;
    transition: background 130ms ease, color 130ms ease;
}

.lang-option:hover,
.lang-option:focus {
    background: rgba(255, 255, 255, 0.22);
    color: white;
}

/* Valt språk — fetare och lätt highlight */
.lang-option--selected {
    font-weight: 800;
    color: white;
    background: rgba(255, 255, 255, 0.14);
}

/* Tangentbordsfokus-ring (visuell, inte mus) */
.lang-option:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: -2px;
}

/* ── Page center wrapper ── */
.page-center {
    width: 100%;
    max-width: 436px;
    z-index: 1;
    animation: rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(28px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Login card ── */
.login-card {
    background: var(--card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 48px 44px 44px;
    position: relative;
    overflow: hidden;
}

/* Subtle top-edge color stripe */
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--grad-a), var(--grad-c));
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

/* ── Login header ── */
.login-head {
    text-align: center;
    margin-bottom: 36px;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--grad-a), var(--grad-b));
    box-shadow: 0 8px 24px rgba(26, 95, 168, 0.4);
    margin-bottom: 20px;
    animation: logoPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes logoPop {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

.app-logo svg {
    width: 48px;
    height: 48px;
}

.app-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.app-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0.1px;
}

/* ── Alerts ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    animation: alertSlide 0.3s ease both;
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ── Form fields ── */
.field-group {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-3);
    pointer-events: none;
    transition: color var(--transition);
    z-index: 1;
}

.field-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-input);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-1);
    background: #fafafa;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow   var(--transition),
        background   var(--transition);
    -webkit-appearance: none;
}

.field-input::placeholder {
    color: var(--text-3);
    font-weight: 400;
}

.field-input:focus {
    border-color: var(--border-f);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26, 95, 168, 0.12);
}

.field-wrap:focus-within .field-icon {
    color: var(--accent);
}

/* Password toggle button */
.toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: var(--text-3);
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}

.toggle-pw:hover {
    color: var(--accent);
    background: rgba(26, 95, 168, 0.08);
}

.pw-eye {
    width: 18px;
    height: 18px;
}

/* ── Remember-me row ── */
.remember-row {
    margin: 4px 0 28px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.check-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.check-input:focus-visible + .check-box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.check-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    flex-shrink: 0;
    background: #fafafa;
    transition:
        border-color var(--transition),
        background   var(--transition),
        box-shadow   var(--transition);
}

.check-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) scale(0) translateY(-1px);
    transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.check-input:checked + .check-box {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.18);
}

.check-input:checked + .check-box::after {
    transform: rotate(45deg) scale(1) translateY(-1px);
}

.check-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
}

/* ── Submit button ── */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 100%);
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 20px rgba(26, 95, 168, 0.45);
    transition:
        transform     var(--transition),
        box-shadow    var(--transition),
        filter        var(--transition);
    position: relative;
    overflow: hidden;
}

/* Shine sweep on hover */
.btn-submit::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.45s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(26, 95, 168, 0.5);
    filter: brightness(1.06);
}

.btn-submit:hover::before {
    left: 160%;
}

.btn-submit:active {
    transform: translateY(0px);
    box-shadow: 0 4px 14px rgba(26, 95, 168, 0.35);
    filter: brightness(0.98);
}

.btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform var(--transition);
}

.btn-submit:hover .btn-arrow {
    transform: translateX(3px);
}

/* ── Responsive adjustments ── */
@media (max-width: 480px) {
    .login-card {
        padding: 40px 28px 36px;
        border-radius: 20px;
    }

    .app-logo {
        width: 68px;
        height: 68px;
        border-radius: 18px;
    }

    .app-logo svg {
        width: 42px;
        height: 42px;
    }

    .app-title {
        font-size: 22px;
    }

    .lang-switcher {
        top: 14px;
        right: 14px;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 36px 22px 32px;
    }
}

/* ── Focus-visible only ring (keyboard nav) ── */
.btn-submit:focus-visible,
.check-label:focus-visible,
.toggle-pw:focus-visible {
    outline: 3px solid rgba(255,255,255,0.7);
    outline-offset: 2px;
}

.field-input:focus-visible {
    outline: none; /* handled by box-shadow above */
}

/* ============================================================
   Inline MFA step — animated reveal below the password field
   ============================================================ */

/* The MFA section starts collapsed and slides open */
.mfa-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    /* visibility removes the hidden OTP boxes from the tab order -
       without it, tabbing from the password field walks through
       six invisible inputs before reaching "Kom ihåg mig" */
    visibility: hidden;
    transform: translateY(-6px);
    /* Use a smooth spring-ish curve for the reveal */
    transition:
        max-height 0.48s cubic-bezier(0.16, 1, 0.3, 1),
        opacity    0.35s ease,
        visibility 0s linear 0.35s,
        transform  0.38s ease;
}

.mfa-section.mfa-visible {
    max-height: 440px; /* enough for 6-box OTP + info bubble + links */
    opacity: 1;
    visibility: visible;
    transition:
        max-height 0.48s cubic-bezier(0.16, 1, 0.3, 1),
        opacity    0.35s ease,
        visibility 0s,
        transform  0.38s ease;
    transform: translateY(0);
}

/* Step divider — thin line with label in the middle */
.mfa-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
}

.mfa-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.mfa-divider-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
    white-space: nowrap;
}

/* Info bubble for method-specific messages */
.alert-mfa-info {
    background: rgba(26, 95, 168, 0.07);
    border: 1px solid rgba(26, 95, 168, 0.2);
    color: var(--accent);
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-mfa-info .alert-icon {
    color: var(--accent);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

/* ── OTP 6-box input ──────────────────────────────────────────────────── */

/* Wrapper gives the label consistent spacing above the box row */
.otp-field-group {
    margin-bottom: 16px;
}

.otp-label {
    text-align: center;
    display: block;
    margin-bottom: 14px;
}

/* Flex row of 6 equally-sized boxes */
.otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Slightly wider gap between positions 3 and 4 to aid readability */
.otp-box:nth-child(3) {
    margin-right: 8px;
}

.otp-box {
    flex: 1 1 0;
    min-width: 0;
    max-width: 48px;
    aspect-ratio: 6 / 7;   /* keeps ~48×56 proportions as boxes shrink */
    padding: 0;
    text-align: center;
    font-family: 'Nunito', ui-monospace, monospace;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-1);
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    /* Hide browser-native spin buttons if type ever becomes "number" */
    -moz-appearance: textfield;
    cursor: text;
    /* Smooth all state transitions */
    transition:
        border-color 150ms ease,
        box-shadow   150ms ease,
        background   150ms ease,
        transform    120ms ease;
}

/* Remove spin buttons in WebKit */
.otp-box::-webkit-inner-spin-button,
.otp-box::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Active / focused box — lift slightly and highlight */
.otp-box:focus {
    border-color: var(--border-f);
    box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.15);
    transform: translateY(-2px) scale(1.04);
    z-index: 1;
    position: relative;
}

/* Box that has a digit — subtle blue tint */
.otp-box.otp-filled {
    border-color: #93c5fd;
    background: #f0f7ff;
}

.otp-box.otp-filled:focus {
    border-color: var(--border-f);
    background: var(--card);
}

/* Error state: red borders + horizontal shake animation */
.otp-group.otp-error .otp-box {
    border-color: #fca5a5;
    background: #fef2f2;
    animation: otp-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes otp-shake {
    0%,  100% { transform: translateX(0); }
    18%        { transform: translateX(-5px) rotate(-0.8deg); }
    36%        { transform: translateX( 5px) rotate( 0.8deg); }
    54%        { transform: translateX(-4px) rotate(-0.4deg); }
    72%        { transform: translateX( 4px) rotate( 0.4deg); }
    90%        { transform: translateX(-2px); }
}

/* Mobile: flex boxes shrink to fit; reduce gap and separator for narrow screens */
@media (max-width: 480px) {
    .otp-group  { gap: 8px; }
    .otp-box    { font-size: 20px; border-radius: 10px; }
    .otp-box:nth-child(3) { margin-right: 4px; }
}

@media (max-width: 360px) {
    .otp-group  { gap: 5px; }
    .otp-box:nth-child(3) { margin-right: 2px; }
}

/* Inline MFA error (sits just below the code field) */
.mfa-inline-error {
    margin-top: -8px;
    margin-bottom: 14px;
}

/* Resend / cancel links row */
.mfa-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    margin-bottom: 4px;
}

.mfa-resend-btn,
.mfa-cancel-btn {
    background: none;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color 150ms ease;
    line-height: 1;
}

.mfa-resend-btn {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mfa-resend-btn:hover  { color: var(--accent-h); }
.mfa-resend-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.mfa-cancel-btn {
    color: var(--text-3);
}

.mfa-cancel-btn:hover { color: var(--text-2); }

/* Hide remember-me row once MFA section is open */
.remember-row.mfa-hidden {
    display: none;
}

/* ── Submit button loading state ── */
.btn-submit.loading {
    opacity: 0.85;
    cursor: not-allowed;
}

.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}

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

/* Alert entrance animation (also used for mfa-inline-error) */
@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert[hidden] { display: none !important; }

.alert:not([hidden]) {
    animation: alertSlide 0.25s ease both;
}

/* ============================================================
   Registreringssida — tillägg
   ============================================================ */

/* ── Länk under inloggningsformuläret ── */
.reg-nav-link {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.register-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--transition);
}

.register-link strong {
    color: var(--accent);
}

.register-link:hover {
    color: var(--accent-h);
}

.register-link:hover strong {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Registreringssida — kortjustering ── */
.reg-page-center {
    max-width: 480px;
    padding-bottom: 32px;
}

.reg-card {
    /* Scroll inuti kortet om sidan är för hög på mobil */
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    /* Dölj scrollbar men bevara funktion */
    scrollbar-width: thin;
    scrollbar-color: rgba(26,95,168,.18) transparent;
}

.reg-card::-webkit-scrollbar       { width: 4px; }
.reg-card::-webkit-scrollbar-track { background: transparent; }
.reg-card::-webkit-scrollbar-thumb { background: rgba(26,95,168,.18); border-radius: 4px; }

/* ── Sektionsdelare inuti formuläret ── */
.reg-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 24px;
}

.reg-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.reg-divider-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
    white-space: nowrap;
}

/* ── Inline fältetikett — "valfri" ── */
.field-label-optional {
    font-weight: 500;
    color: var(--text-3);
    font-size: 12px;
    margin-left: 3px;
}

/* ── Hjälptext under fält ── */
.field-hint {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    margin-top: 5px;
    margin-bottom: 0;
    padding-left: 2px;
}

/* ── Inlinefelmeddelande under fält ── */
.field-error-inline {
    font-size: 12px;
    font-weight: 700;
    color: #b91c1c;
    margin-top: 6px;
    margin-bottom: 0;
    padding-left: 2px;
    animation: alertSlide 0.2s ease both;
}

.field-error-inline[hidden] { display: none; }

/* ── Inbjudningskod — monospace-känsla ── */
.reg-invite-code {
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ── GDPR-samtyckesrad ── */
.reg-consent-row {
    margin: 20px 0 28px;
}

.reg-consent-text {
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
}

.reg-policy-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.reg-policy-link:hover { color: var(--accent-h); }

/* ── Bekräftelsestatus ── */
.reg-success-wrap {
    text-align: center;
    padding: 20px 0 12px;
    animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reg-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(145deg, #16a34a, #22c55e);
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.38);
    margin: 0 auto 24px;
    animation: logoPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.reg-success-icon svg {
    width: 36px;
    height: 36px;
}

.reg-success-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.reg-success-body {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 28px;
}

.reg-login-btn {
    text-decoration: none !important;
}

/* ── Länk tillbaka till inloggning ── */
.reg-back-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}

.reg-back-link a {
    color: var(--text-3);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.reg-back-link a:hover { color: var(--accent); }

/* ── Mobil — kortets vertikala utrymme ── */
@media (max-width: 480px) {
    .reg-page-center { padding-bottom: 20px; }
    .reg-card        { max-height: calc(100dvh - 24px); }
}
