:root {
    --se-auth-navy: #112736;
    --se-auth-navy-deep: #081a26;
    --se-auth-blue: #113d9f;
    --se-auth-blue-light: #2b7fff;
    --se-auth-green: #0b6e3d;
    --se-auth-border: #dce3ec;
    --se-auth-muted: #657386;
    --se-auth-text: #263241;
    --se-auth-background: #eef2f7;
    --se-auth-surface: #ffffff;
    --se-auth-danger: #b42318;
    --se-auth-warning: #9a6417;
    --se-auth-shadow: 0 28px 80px rgba(8, 26, 38, .22);
    --se-auth-shadow-soft: 0 10px 30px rgba(17, 39, 54, .10);
}

html,
body.se-auth-page {
    min-height: 100%;
    margin: 0;
}

body.se-auth-page {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--se-auth-text);
    background:
        radial-gradient(circle at 8% 12%, rgba(43, 127, 255, .18), transparent 24rem),
        radial-gradient(circle at 92% 88%, rgba(11, 110, 61, .11), transparent 26rem),
        linear-gradient(135deg, #e9eef5 0%, #f7f9fc 48%, #edf2f8 100%);
    font-family: "IBM Plex Sans", "Nunito", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.se-auth-page *,
body.se-auth-page *::before,
body.se-auth-page *::after {
    box-sizing: border-box;
}

body.se-auth-page a {
    color: var(--se-auth-blue);
    font-weight: 620;
    text-decoration: none;
    text-underline-offset: 3px;
}

body.se-auth-page a:hover {
    color: #0c3287;
    text-decoration: underline;
}

.se-auth-shell {
    display: grid;
    width: min(1160px, calc(100% - 36px));
    min-height: min(760px, calc(100vh - 36px));
    margin: 18px auto;
    overflow: hidden;
    grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 26px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--se-auth-shadow);
    backdrop-filter: blur(18px);
}

.se-auth-brand-panel {
    position: relative;
    display: flex;
    min-height: 100%;
    padding: clamp(34px, 5vw, 66px);
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(circle at 12% 8%, rgba(80, 143, 255, .42), transparent 21rem),
        radial-gradient(circle at 88% 94%, rgba(24, 153, 94, .24), transparent 23rem),
        linear-gradient(155deg, var(--se-auth-navy-deep), var(--se-auth-navy) 52%, var(--se-auth-blue));
}

.se-auth-brand-panel::before,
.se-auth-brand-panel::after {
    position: absolute;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 50%;
}

.se-auth-brand-panel::before {
    top: -120px;
    right: -110px;
    width: 340px;
    height: 340px;
}

.se-auth-brand-panel::after {
    right: 42px;
    bottom: -145px;
    width: 290px;
    height: 290px;
}

.se-auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: #fff;
}

.se-auth-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 16px;
    background: rgba(255, 255, 255, .10);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
}

.se-auth-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.se-auth-brand-copy strong {
    font-size: 1.16rem;
    font-weight: 760;
    letter-spacing: .01em;
}

.se-auth-brand-copy small {
    margin-top: 4px;
    color: rgba(255, 255, 255, .62);
    font-size: .69rem;
    font-weight: 650;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.se-auth-hero {
    position: relative;
    z-index: 1;
    max-width: 490px;
    margin: auto 0;
    padding: 44px 0;
}

.se-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 10px;
    color: rgba(255, 255, 255, .84);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    font-size: .72rem;
    font-weight: 680;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.se-auth-hero h1 {
    max-width: 13ch;
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 730;
    line-height: 1.04;
    letter-spacing: -.045em;
}

.se-auth-hero p {
    max-width: 46ch;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, .70);
    font-size: .98rem;
    line-height: 1.7;
}

.se-auth-feature-list {
    display: grid;
    margin: 30px 0 0;
    padding: 0;
    gap: 11px;
    list-style: none;
}

.se-auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .80);
    font-size: .84rem;
}

.se-auth-feature-list i {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 9px;
    background: rgba(255, 255, 255, .09);
    font-size: .7rem;
}

.se-auth-brand-footer {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, .48);
    font-size: .73rem;
}

.se-auth-form-panel {
    display: flex;
    min-width: 0;
    padding: clamp(28px, 5vw, 72px);
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 100% 0, rgba(17, 61, 159, .045), transparent 20rem),
        rgba(255, 255, 255, .92);
}

.se-auth-card {
    width: min(100%, 430px);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.se-auth-card-logo {
    display: none;
    max-width: 180px;
    max-height: 72px;
    margin: 0 auto 28px;
    object-fit: contain;
}

.se-auth-card-header {
    margin-bottom: 28px;
}

.se-auth-card-header h2 {
    margin: 0;
    color: var(--se-auth-navy);
    font-size: clamp(1.65rem, 2.4vw, 2.1rem);
    font-weight: 740;
    letter-spacing: -.035em;
}

.se-auth-card-header p {
    margin: 9px 0 0;
    color: var(--se-auth-muted);
    font-size: .91rem;
    line-height: 1.55;
}

.se-auth-field {
    position: relative;
    margin-bottom: 18px;
}

.se-auth-field label,
.se-auth-label {
    display: block;
    margin: 0 0 7px;
    color: #435166;
    font-size: .79rem;
    font-weight: 680;
}

.se-auth-input-wrap {
    position: relative;
}

.se-auth-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    color: #8290a2;
    font-size: .88rem;
    transform: translateY(-50%);
    pointer-events: none;
}

body.se-auth-page .se-auth-input,
body.se-auth-page input.input,
body.se-auth-page select.input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px 0 42px;
    color: var(--se-auth-text);
    border: 1px solid #cdd7e3;
    border-radius: 12px;
    outline: none;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 39, 54, .025);
    font-size: .92rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

body.se-auth-page select.input {
    padding-right: 38px;
    appearance: auto;
}

body.se-auth-page .se-auth-input::placeholder,
body.se-auth-page input.input::placeholder {
    color: #9aa6b4;
}

body.se-auth-page .se-auth-input:hover,
body.se-auth-page input.input:hover,
body.se-auth-page select.input:hover {
    border-color: #aebccd;
}

body.se-auth-page .se-auth-input:focus,
body.se-auth-page input.input:focus,
body.se-auth-page select.input:focus {
    border-color: var(--se-auth-blue);
    box-shadow: 0 0 0 4px rgba(17, 61, 159, .11);
}

body.se-auth-page .se-auth-input:disabled,
body.se-auth-page input.input:disabled,
body.se-auth-page select.input:disabled {
    color: #7f8a98;
    background: #eef2f6;
}

.se-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 24px;
    font-size: .82rem;
}

.se-auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #526175;
    cursor: pointer;
    user-select: none;
}

.se-auth-checkbox input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--se-auth-blue);
}

body.se-auth-page .submit-btn,
body.se-auth-page .se-auth-submit,
body.se-auth-page button.submit {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 12px 18px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #fff;
    border: 1px solid var(--se-auth-blue);
    border-radius: 12px;
    outline: none;
    background: linear-gradient(135deg, var(--se-auth-blue), #245bc3);
    box-shadow: 0 11px 24px rgba(17, 61, 159, .20);
    font-size: .94rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

body.se-auth-page .submit-btn:hover:not(:disabled),
body.se-auth-page .se-auth-submit:hover:not(:disabled),
body.se-auth-page button.submit:hover:not(:disabled) {
    color: #fff;
    background: linear-gradient(135deg, #0c3287, var(--se-auth-blue));
    box-shadow: 0 15px 30px rgba(17, 61, 159, .26);
    transform: translateY(-1px);
}

body.se-auth-page .submit-btn:focus-visible,
body.se-auth-page .se-auth-submit:focus-visible,
body.se-auth-page button.submit:focus-visible {
    outline: 4px solid rgba(17, 61, 159, .17);
    outline-offset: 2px;
}

body.se-auth-page .submit-btn:disabled,
body.se-auth-page .se-auth-submit:disabled,
body.se-auth-page button.submit:disabled,
body.se-auth-page .submit-btn.bg-secondary {
    color: #7b8794;
    border-color: #d4dbe4;
    background: #e8edf3 !important;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.se-auth-secondary-button {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--se-auth-text) !important;
    border: 1px solid #cdd7e3;
    border-radius: 12px;
    background: #fff;
    font-size: .87rem;
    font-weight: 650;
    text-decoration: none !important;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.se-auth-secondary-button:hover {
    border-color: #aebccd;
    background: #f7f9fc;
    transform: translateY(-1px);
}

.se-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #94a0af;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.se-auth-divider::before,
.se-auth-divider::after {
    height: 1px;
    flex: 1 1 auto;
    content: "";
    background: var(--se-auth-border);
}

.se-auth-hint {
    margin: 18px 0 0;
    color: var(--se-auth-muted);
    font-size: .79rem;
    line-height: 1.55;
    text-align: center;
}

.se-auth-step {
    display: flex;
    gap: 10px;
    margin: 0 0 26px;
}

.se-auth-step span {
    display: flex;
    min-width: 0;
    flex: 1 1 0;
    align-items: center;
    gap: 7px;
    color: #8793a2;
    font-size: .72rem;
    font-weight: 620;
}

.se-auth-step span::before {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    content: attr(data-step);
    place-items: center;
    color: #647184;
    border: 1px solid #ced7e1;
    border-radius: 8px;
    background: #f7f9fc;
    font-size: .68rem;
}

.se-auth-step span.active {
    color: var(--se-auth-blue);
}

.se-auth-step span.active::before {
    color: #fff;
    border-color: var(--se-auth-blue);
    background: var(--se-auth-blue);
}

.se-auth-inline-actions {
    display: grid;
    gap: 10px;
}

/* Contract / municipality selector */
.se-selection-page .se-auth-shell {
    grid-template-columns: minmax(340px, .8fr) minmax(430px, 1.2fr);
}

.se-selection-card {
    width: min(100%, 500px);
}

.se-selection-summary {
    display: grid;
    margin: 26px 0 0;
    gap: 10px;
}

.se-selection-summary-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--se-auth-border);
    border-radius: 12px;
    background: #f8fafc;
}

.se-selection-summary-item i {
    display: grid;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    place-items: center;
    color: var(--se-auth-blue);
    border-radius: 9px;
    background: #eaf1ff;
}

.se-selection-summary-item strong {
    display: block;
    color: var(--se-auth-navy);
    font-size: .82rem;
}

.se-selection-summary-item small {
    display: block;
    margin-top: 2px;
    color: var(--se-auth-muted);
    line-height: 1.4;
}

/* Registration page */
.se-register-card {
    width: min(100%, 570px);
}

.se-register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

.se-register-grid .se-auth-field-full {
    grid-column: 1 / -1;
}

/* Bootstrap modals on auth pages */
body.se-auth-page .modal-backdrop.show {
    opacity: .44;
    backdrop-filter: blur(3px);
}

body.se-auth-page .modal-content {
    overflow: hidden;
    border: 1px solid rgba(220, 227, 236, .92);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(8, 26, 38, .25);
}

body.se-auth-page .modal-header {
    min-height: 60px;
    padding: 15px 18px;
    color: var(--se-auth-navy);
    border-bottom: 1px solid var(--se-auth-border);
    background: linear-gradient(180deg, #fff, #fafcff) !important;
}

body.se-auth-page .modal-header.alert-success {
    color: var(--se-auth-green);
    background: #e8f6ee !important;
}

body.se-auth-page .modal-header.alert-warning {
    color: var(--se-auth-warning);
    background: #fff6df !important;
}

body.se-auth-page .modal-header.alert-danger {
    color: var(--se-auth-danger);
    background: #fff0ef !important;
}

body.se-auth-page .modal-title {
    font-size: 1rem;
    font-weight: 720;
}

body.se-auth-page .modal-body {
    padding: 20px;
    color: var(--se-auth-text);
    background: #fff !important;
    line-height: 1.55;
}

body.se-auth-page .modal-footer {
    gap: 8px;
    padding: 13px 18px;
    border-top: 1px solid var(--se-auth-border);
    background: #f8fafc !important;
}

body.se-auth-page .modal-footer .btn {
    min-width: 90px;
    min-height: 40px;
    border-radius: 10px;
    font-weight: 650;
}

body.se-auth-page #resetPasswordModal .modal-dialog {
    max-width: 520px;
}

body.se-auth-page #resetPasswordModal .se-auth-card {
    width: 100%;
}

.se-auth-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--se-auth-muted);
    font-size: .77rem;
}

.se-auth-status i {
    color: var(--se-auth-blue);
}

@media (max-width: 991.98px) {
    .se-auth-shell,
    .se-selection-page .se-auth-shell {
        width: min(760px, calc(100% - 28px));
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .se-auth-brand-panel {
        min-height: 300px;
        padding: 32px;
    }

    .se-auth-hero {
        padding: 36px 0 18px;
    }

    .se-auth-hero h1 {
        max-width: 18ch;
        font-size: clamp(2rem, 7vw, 3rem);
    }

    .se-auth-feature-list,
    .se-auth-brand-footer {
        display: none;
    }

    .se-auth-form-panel {
        padding: 44px 32px;
    }
}

@media (max-width: 575.98px) {
    .se-auth-shell,
    .se-selection-page .se-auth-shell {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .se-auth-brand-panel {
        min-height: 205px;
        padding: 24px 20px;
    }

    .se-auth-brand img {
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .se-auth-hero {
        padding: 28px 0 0;
    }

    .se-auth-eyebrow,
    .se-auth-hero p {
        display: none;
    }

    .se-auth-hero h1 {
        max-width: 15ch;
        font-size: 2rem;
    }

    .se-auth-form-panel {
        padding: 36px 20px 44px;
        align-items: flex-start;
    }

    .se-auth-card-header {
        margin-bottom: 23px;
    }

    .se-auth-options {
        align-items: flex-start;
        flex-direction: column;
    }

    .se-register-grid {
        grid-template-columns: 1fr;
    }

    .se-register-grid .se-auth-field-full {
        grid-column: auto;
    }

    .se-auth-step {
        overflow-x: auto;
    }

    .se-auth-step span {
        min-width: max-content;
    }

    body.se-auth-page .modal-dialog {
        margin: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.se-auth-page *,
    body.se-auth-page *::before,
    body.se-auth-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
