@charset "UTF-8";

:root {
    color-scheme: dark;

    --background-top: #030914;
    --background-bottom: #000205;

    --electric-blue: #087cff;
    --electric-blue-light: #18a8ff;

    --button-blue-top: #0c83ff;
    --button-blue-middle: #0864d6;
    --button-blue-bottom: #0744a7;

    --text-primary: #ffffff;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background-color: var(--background-bottom);
}

body.minimal-login-page {
    position: relative;

    min-height: 100vh;
    min-height: 100svh;

    margin: 0;
    overflow-x: hidden;

    display: flex;
    justify-content: center;
    align-items: center;

    color: var(--text-primary);

    background:
        radial-gradient(
            ellipse 34% 8% at 50% 94%,
            rgba(0, 132, 255, 0.24) 0%,
            rgba(0, 92, 220, 0.10) 38%,
            transparent 76%
        ),
        radial-gradient(
            circle at 50% 43%,
            rgba(0, 74, 164, 0.13) 0%,
            transparent 38%
        ),
        radial-gradient(
            circle at 13% 66%,
            rgba(0, 93, 255, 0.09) 0%,
            transparent 28%
        ),
        radial-gradient(
            circle at 88% 24%,
            rgba(0, 93, 255, 0.10) 0%,
            transparent 28%
        ),
        linear-gradient(
            180deg,
            var(--background-top) 0%,
            #01050d 55%,
            var(--background-bottom) 100%
        );

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    isolation: isolate;
}

/*
 * Elektriska blixtar i bakgrunden.
 * De skapas direkt i CSS och kräver därför ingen extra bildfil.
 */

body.minimal-login-page::before,
body.minimal-login-page::after {
    content: "";

    position: fixed;
    z-index: 0;

    width: min(48vw, 700px);
    height: min(78vh, 900px);

    pointer-events: none;
    opacity: 0.42;

    background:
        center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 900'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M500 35 430 148 457 206 350 314 378 370 275 472 302 520 205 620 228 670 80 845' stroke='%230071ff' stroke-width='4' opacity='.95'/%3E%3Cpath d='M430 148 350 125 292 78' stroke='%230071ff' stroke-width='2.4' opacity='.72'/%3E%3Cpath d='M457 206 500 248' stroke='%230071ff' stroke-width='2.1' opacity='.62'/%3E%3Cpath d='M350 314 285 288 230 220' stroke='%230071ff' stroke-width='2.5' opacity='.66'/%3E%3Cpath d='M378 370 445 400 492 456' stroke='%230071ff' stroke-width='2' opacity='.56'/%3E%3Cpath d='M275 472 198 450 140 390' stroke='%230071ff' stroke-width='2.3' opacity='.62'/%3E%3Cpath d='M302 520 366 548 420 608' stroke='%230071ff' stroke-width='2' opacity='.54'/%3E%3Cpath d='M205 620 126 610 58 558' stroke='%230071ff' stroke-width='2.2' opacity='.58'/%3E%3Cpath d='M228 670 302 706 347 770' stroke='%230071ff' stroke-width='2' opacity='.50'/%3E%3C/g%3E%3C/svg%3E");

    filter:
        drop-shadow(0 0 4px rgba(0, 111, 255, 0.95))
        drop-shadow(0 0 16px rgba(0, 83, 255, 0.62));
}

body.minimal-login-page::before {
    left: -9vw;
    bottom: -10vh;
}

body.minimal-login-page::after {
    right: -9vw;
    top: -11vh;

    transform: rotate(180deg);
    opacity: 0.50;
}

/*
 * Huvudytan
 */

.login-wrapper {
    position: relative;
    z-index: 1;

    width: 100%;

    min-height: 100vh;
    min-height: 100svh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding:
        max(28px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(34px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
}

/*
 * Det diskreta blå ljuset längst ned på sidan.
 */

.login-wrapper::after {
    content: "";

    position: fixed;
    left: 50%;
    bottom: clamp(34px, 7vh, 76px);

    width: min(360px, 58vw);
    height: 2px;

    transform: translateX(-50%);
    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(0, 129, 255, 0.90),
            transparent
        );

    box-shadow:
        0 0 10px rgba(0, 130, 255, 0.90),
        0 0 30px rgba(0, 94, 255, 0.48);

    opacity: 0.56;
}

.login-container {
    width: min(640px, 100%);

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    /*
     * Flyttar innehållet en aning uppåt,
     * precis som i den valda layouten.
     */
    transform: translateY(-1.5vh);
}

/*
 * Logotyp
 */

.logo-container {
    width: min(640px, 100%);
    margin: 0 auto 4px;
}

/*
 * Bildfilen har stora svarta marginaler ovanför och under loggan.
 * Den här behållaren beskär bort dem visuellt.
 */

.logo-window {
    width: 100%;
    aspect-ratio: 2.82 / 1;

    margin: 0 auto;
    overflow: hidden;

    -webkit-mask-image:
        radial-gradient(
            ellipse 88% 88% at 50% 52%,
            #000000 58%,
            rgba(0, 0, 0, 0.92) 72%,
            transparent 100%
        );

    mask-image:
        radial-gradient(
            ellipse 88% 88% at 50% 52%,
            #000000 58%,
            rgba(0, 0, 0, 0.92) 72%,
            transparent 100%
        );
}

.main-logo {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: 50% 51%;

    /*
     * Gör att den svarta delen av PNG-bilden smälter ihop
     * med sidans bakgrund i stället för att se ut som en ruta.
     */
    mix-blend-mode: screen;

    filter:
        drop-shadow(
            0 0 16px rgba(0, 106, 255, 0.20)
        );

    user-select: none;
    -webkit-user-drag: none;
}

/*
 * Texten PORTAL med blå linjer på sidorna
 */

.portal-marker {
    width: min(400px, 78%);

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    gap: clamp(14px, 3vw, 22px);

    margin:
        clamp(6px, 1.2vh, 14px)
        0
        clamp(30px, 4.2vh, 44px);

    color: var(--electric-blue);

    font-size: clamp(15px, 2.1vw, 20px);
    font-weight: 700;
    line-height: 1;

    letter-spacing: 0.48em;
    text-indent: 0.48em;

    text-shadow:
        0 0 12px rgba(0, 116, 255, 0.65);
}

.portal-marker::before,
.portal-marker::after {
    content: "";

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(0, 127, 255, 0.96)
        );

    box-shadow:
        0 0 8px rgba(0, 122, 255, 0.58);
}

.portal-marker::after {
    background:
        linear-gradient(
            90deg,
            rgba(0, 127, 255, 0.96),
            transparent
        );
}

/*
 * Knappar
 */

.login-content {
    width: min(520px, 100%);
}

.button-container {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 18px;
}

.button {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 64px;

    padding: 15px 24px;

    border-radius: 8px;

    color: var(--text-primary);

    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;

    text-align: center;
    text-decoration: none;

    cursor: pointer;
    overflow: hidden;

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;

    -webkit-tap-highlight-color: transparent;
}

/*
 * Diskret ljusreflektion som passerar över knappen vid hover.
 */

.button::before {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            115deg,
            transparent 20%,
            rgba(255, 255, 255, 0.16) 48%,
            transparent 74%
        );

    transform: translateX(-130%);
    transition: transform 420ms ease;
}

.button:hover::before {
    transform: translateX(130%);
}

.button:hover {
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
}

.button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.96);
    outline-offset: 4px;
}

/*
 * Primär knapp – Logga in
 */

.button.login {
    border: 1px solid var(--electric-blue-light);

    background:
        linear-gradient(
            180deg,
            var(--button-blue-top) 0%,
            var(--button-blue-middle) 43%,
            var(--button-blue-bottom) 100%
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 99, 255, 0.12),
        0 10px 24px rgba(0, 65, 180, 0.26),
        0 0 22px rgba(0, 116, 255, 0.20);
}

.button.login:hover {
    border-color: #6bcaff;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.36),
        0 12px 28px rgba(0, 74, 205, 0.34),
        0 0 30px rgba(0, 132, 255, 0.32);
}

/*
 * Sekundär knapp – Skapa nytt konto
 */

.button.new-user {
    border: 1px solid rgba(47, 133, 255, 0.84);

    background:
        linear-gradient(
            180deg,
            rgba(7, 19, 39, 0.72),
            rgba(1, 7, 17, 0.86)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 20px rgba(0, 0, 0, 0.30),
        0 0 16px rgba(0, 96, 255, 0.08);
}

.button.new-user:hover {
    border-color: var(--electric-blue-light);

    background:
        linear-gradient(
            180deg,
            rgba(9, 36, 73, 0.82),
            rgba(2, 12, 27, 0.92)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 10px 22px rgba(0, 0, 0, 0.34),
        0 0 24px rgba(0, 111, 255, 0.16);
}

/*
 * Mobilanpassning
 */

@media (max-width: 600px) {
    body.minimal-login-page::before,
    body.minimal-login-page::after {
        width: 72vw;
        opacity: 0.26;
    }

    .login-container {
        width: min(480px, 100%);
    }

    .logo-container {
        width: min(520px, 100%);
    }

    .portal-marker {
        width: min(330px, 82%);

        letter-spacing: 0.40em;
        text-indent: 0.40em;

        margin-bottom: 30px;
    }

    .login-content {
        width: min(420px, 100%);
    }

    .button {
        min-height: 58px;

        font-size: 17px;
        border-radius: 7px;
    }
}

/*
 * Anpassning för låga skärmar och liggande mobiler.
 */

@media (max-height: 720px) {
    .login-wrapper {
        align-items: flex-start;

        padding-top:
            max(24px, env(safe-area-inset-top));

        padding-bottom:
            max(28px, env(safe-area-inset-bottom));
    }

    .login-container {
        transform: none;
    }

    .logo-container {
        width: min(520px, 100%);
    }

    .portal-marker {
        margin-top: 0;
        margin-bottom: 24px;
    }

    .button {
        min-height: 56px;
    }

    .login-wrapper::after {
        display: none;
    }
}

/*
 * Tar bort rörelser för användare som har begärt
 * minskade animationer i sin enhet.
 */

@media (prefers-reduced-motion: reduce) {
    .button,
    .button::before {
        transition: none;
    }
}

/*
 * Inloggningsmodal
 */

.portal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;
    place-items: center;

    padding: 20px;
}

.portal-modal.is-open {
    display: grid;
}

.portal-modal-backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(0, 3, 10, 0.76);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.portal-modal-dialog {
    position: relative;
    z-index: 1;

    width: min(430px, 100%);

    padding: 34px 32px 30px;

    border:
        1px solid rgba(24, 168, 255, 0.70);

    border-radius: 12px;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(8, 124, 255, 0.15),
            transparent 42%
        ),
        linear-gradient(
            180deg,
            rgba(5, 15, 31, 0.98),
            rgba(1, 6, 15, 0.99)
        );

    box-shadow:
        0 0 0 1px rgba(0, 91, 255, 0.10),
        0 24px 80px rgba(0, 0, 0, 0.65),
        0 0 34px rgba(0, 116, 255, 0.24);
}

.portal-modal-close {
    position: absolute;

    top: 12px;
    right: 14px;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    color: #9ab9d5;
    background: transparent;

    font-size: 28px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;
}

.portal-modal-close:hover {
    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.06);
}

.portal-modal-marker {
    margin: 0 0 8px;

    color: var(--electric-blue);

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.20em;

    text-align: center;

    text-shadow:
        0 0 12px rgba(0, 116, 255, 0.65);
}

.portal-modal-dialog h2 {
    margin: 0;

    color: #ffffff;

    font-size: 26px;
    font-weight: 700;

    text-align: center;
}

.portal-modal-intro {
    margin: 10px 0 25px;

    color: #9eabb9;

    font-size: 14px;
    line-height: 1.5;

    text-align: center;
}

.portal-login-form {
    display: grid;
    gap: 18px;
}

.portal-login-field {
    display: grid;
    gap: 7px;
}

.portal-login-field label {
    color: #dbe7f3;

    font-size: 14px;
    font-weight: 600;
}

.portal-login-field input {
    width: 100%;
    min-height: 50px;

    padding: 11px 13px;

    border:
        1px solid rgba(79, 132, 190, 0.65);

    border-radius: 7px;

    outline: none;

    color: #ffffff;

    background:
        rgba(0, 5, 14, 0.84);

    font: inherit;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.portal-login-field input:focus {
    border-color: var(--electric-blue-light);

    box-shadow:
        0 0 0 3px rgba(8, 124, 255, 0.17),
        0 0 18px rgba(0, 116, 255, 0.13);
}

.portal-login-submit {
    min-height: 52px;

    margin-top: 4px;

    border:
        1px solid var(--electric-blue-light);

    border-radius: 7px;

    color: #ffffff;

    background:
        linear-gradient(
            180deg,
            var(--button-blue-top) 0%,
            var(--button-blue-middle) 43%,
            var(--button-blue-bottom) 100%
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 8px 24px rgba(0, 65, 180, 0.28);

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}

.portal-login-submit:hover {
    border-color: #6bcaff;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 10px 28px rgba(0, 74, 205, 0.38),
        0 0 24px rgba(0, 132, 255, 0.22);
}

.portal-login-create-account {
    margin: 24px 0 0;

    padding-top: 18px;

    border-top:
        1px solid rgba(91, 123, 153, 0.28);

    color: #8495a5;

    font-size: 13px;

    text-align: center;
}

.portal-login-create-account a {
    color: var(--electric-blue-light);

    font-weight: 600;
}

.portal-login-error {
    margin: 0 0 20px;
    padding: 12px 14px;

    border:
        1px solid rgba(255, 97, 97, 0.55);

    border-radius: 7px;

    color: #ffd0d0;

    background:
        rgba(111, 19, 28, 0.28);

    font-size: 13px;
    line-height: 1.45;
}

.portal-login-error p {
    margin: 0;
}

.portal-login-error p + p {
    margin-top: 5px;
}

body.login-modal-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .portal-modal {
        align-items: flex-start;
        padding: 18px 14px;
        overflow-y: auto;
    }

    .portal-modal-dialog {
        width: 100%;
        max-width: 430px;

        margin-top: 18px;
        padding: 22px 20px 20px;
    }

    .portal-login-form {
        gap: 13px;
    }

    .portal-login-field {
        gap: 5px;
    }

    .portal-login-field input {
        min-height: 46px;
        padding: 9px 12px;
    }
}
/* Visa/dölj lösenord */

.portal-password-wrapper {
    position: relative;
}

.portal-password-wrapper input {
    width: 100%;
    padding-right: 52px;
}

.portal-password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    padding: 0;

    border: 0;
    background: transparent;
    color: #9aa9bd;

    cursor: pointer;
}

.portal-password-toggle:hover {
    color: #ffffff;
}

.portal-password-toggle:focus-visible {
    outline: 2px solid #1597ff;
    outline-offset: 2px;
    border-radius: 6px;
}

.portal-password-eye {
    width: 22px;
    height: 22px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Ikoner i inloggningsfälten */

.portal-input-wrapper {
    position: relative;
}

.portal-input-wrapper input {
    padding-left: 46px;
}

.portal-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    color: #9aa9bd;

    pointer-events: none;
}

.portal-input-icon-svg {
    display: block;

    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Lösenordsfältet behöver plats både för låset och ögat */

.portal-password-wrapper input {
    padding-left: 46px;
    padding-right: 52px;
}


/* =========================================
   GLÖMT LÖSENORD
   ========================================= */

.portal-password-reset-intro {
    display: grid;
    gap: 10px;

    margin-bottom: 4px;

    text-align: center;
}

.portal-password-reset-intro h2 {
    margin: 0;

    color: #ffffff;

    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
}

.portal-password-reset-intro p {
    margin: 0;

    color: #aebbc9;

    font-size: 15px;
    line-height: 1.55;
}

.portal-reset-message {
    margin: 2px 0 0;

    border-color: rgba(0, 170, 255, 0.45);

    color: #dbefff;

    background:
        rgba(0, 105, 180, 0.14);
}

.portal-forgot-password {
    display: inline-block;

    justify-self: center;

    margin-top: -2px;

    color: #59a9ff;

    font-size: 14px;
    font-weight: 600;
    text-decoration: none;

    transition:
        color 150ms ease,
        opacity 150ms ease;
}

.portal-forgot-password:hover {
    color: #ffffff;
}

.portal-forgot-password:focus-visible {
    outline: 2px solid #1597ff;
    outline-offset: 4px;
    border-radius: 4px;
}

@media (max-width: 520px) {
    .portal-password-reset-intro {
        gap: 8px;
    }

    .portal-password-reset-intro h2 {
        font-size: 23px;
    }

    .portal-password-reset-intro p {
        font-size: 14px;
        line-height: 1.5;
    }

    .portal-forgot-password {
        font-size: 14px;
    }
}

/* =========================================
   GLÖMT LÖSENORD - LAYOUT
   ========================================= */

.portal-reset-content {
    width: min(100%, 520px);
    margin-inline: auto;
}

.portal-reset-content .portal-login-form {
    width: 100%;
}

.portal-reset-content .portal-password-reset-intro {
    margin-bottom: 8px;
}

.portal-reset-content .portal-login-field label {
    text-align: left;
}

.portal-reset-content .portal-login-submit {
    width: 100%;
}

@media (max-width: 520px) {
    .portal-reset-content {
        width: 100%;
    }

    .portal-reset-content .portal-password-reset-intro {
        padding-inline: 4px;
    }
}
/*
 * Bekräftelse efter genomförd kontoaktivering.
 */
.portal-login-success {
    margin: 0 0 20px;
    padding: 12px 14px;

    border:
        1px solid rgba(60, 200, 130, 0.55);

    border-radius: 7px;

    color: #b9f5d6;

    background:
        rgba(25, 128, 78, 0.20);

    font-size: 13px;
    line-height: 1.45;
}

.portal-login-success p {
    margin: 0;
}