﻿/* ============================================================
   LYNGSON AS – login theme
   Brand sampled from lyngson.no:
     • Green accent   #59c45c   (fresh Lyngson green)
     • Wordmark grey  #9b9b9b
     • Text           near-black
     • Fonts          Open Sans (body) + Roboto (headings)
   Layout is fully responsive: a flex-centred card that never
   clips on short screens or phones (no overflow:hidden, no
   absolute positioning, no background-attachment:fixed).
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&family=Roboto:wght@500;700;800&display=swap");

:root {
    /* ---- Brand palette (lyngson.no) ---- */
    --ly-green: #59c45c;        /* exact Lyngson green – accents, top bar, links, focus */
    --ly-green-dark: #2f9e3f;   /* readable button fill (white text) */
    --ly-green-darker: #26833a; /* button hover / active */
    --ly-green-soft: #eaf7ea;   /* soft tint for link hover */
    --ly-grey: #9b9b9b;         /* Lyngson wordmark grey */
    --ly-ink: #1f2320;          /* near-black heading text */
    --ly-text: #3d3c3c;         /* body text */
    --ly-muted: #8a908b;        /* muted captions */

    --card-bg: #ffffff;
    --card-radius: 16px;

    /* ---- Button tokens ---- */
    --btn-bg: var(--ly-green-dark);
    --btn-bg-hover: var(--ly-green-darker);
    --btn-text: #ffffff;
    --btn-radius: 14px;

    /* ---- Fonts (match the live site) ---- */
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-head: 'Roboto', 'Open Sans', Arial, sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* ---- Page: photo backdrop + flex-centred card ----
   The photo URL is injected as --login-bg from Login.cshtml so the
   Razor ~/ path resolves correctly. A dark veil keeps the white card
   and text readable over any photo. */
body {
    font-family: var(--font-body);
    color: var(--ly-text);
    min-height: 100vh;
    min-height: 100dvh;                 /* correct viewport height on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    background: #0b0f14 var(--login-bg, none) center center / cover no-repeat;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 15, 20, 0.45), rgba(9, 15, 20, 0.64));
    z-index: 0;
    pointer-events: none;
}

/* ---- Login card ---- */
.form-wrapper {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    margin: auto;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    border-top: 5px solid var(--ly-green);
    padding: clamp(28px, 5vw, 60px) clamp(24px, 5vw, 56px);
    box-shadow: 0 24px 60px rgba(9, 25, 12, 0.28), 0 6px 16px rgba(0, 0, 0, 0.10);
    animation: card-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.form-wrapper form {
    margin: 0;
}

.form-wrapper a {
    text-decoration: none;
}

    .form-wrapper a:hover {
        text-decoration: underline;
    }

.form-wrapper :where(label, p, small, a) {
    color: var(--ly-text);
}

/* ---- Brand wordmark (Lyngson logo) ---- */
.logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lyngson-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo {
    width: min(220px, 66%);
    height: auto;
    display: block;
}

/* Text fallback wordmark (if the SVG is ever swapped for text) */
.lyngson-wordmark {
    font-family: var(--font-head);
    color: var(--ly-grey);
    font-weight: 800;
    font-size: clamp(2.2rem, 8vw, 3rem);
    letter-spacing: 0.1em;
    line-height: 1;
    user-select: none;
}

.lyngson-accent {
    width: 88px;
    height: 5px;
    border-radius: 3px;
    background: var(--ly-green);
}

/* ---- Welcome label ---- */
.login-label {
    font-family: var(--font-head);
    text-align: center;
    font-size: clamp(1.2rem, 4.5vw, 1.5rem);
    font-weight: 500;
    color: var(--ly-ink);
    margin: clamp(1.6rem, 5vw, 2.6rem) 0 1.4rem;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

/* ---- Provider buttons (Visma / Microsoft) ---- */
.login-providers {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 4px;
}

.btn-neo,
.provider-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    padding: clamp(14px, 2.4vw, 18px) 24px;
    min-height: 60px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)), var(--btn-bg);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--btn-radius);
    color: var(--btn-text);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(16px, 1.2vw, 19px);
    letter-spacing: 0.2px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 22px rgba(20, 90, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    -webkit-tap-highlight-color: transparent;
}

    .btn-neo:hover,
    .provider-btn:hover {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)), var(--btn-bg-hover);
        border-color: rgba(255, 255, 255, 0.45);
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(20, 90, 30, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    .btn-neo:active,
    .provider-btn:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(20, 90, 30, 0.22);
    }

    .provider-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(89, 196, 92, 0.5), 0 12px 26px rgba(20, 90, 30, 0.26);
    }

/* Keep provider buttons on the Lyngson green theme */
.visma-btn,
.microsoft-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)), var(--btn-bg) !important;
    color: var(--btn-text) !important;
}

.provider-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex: 0 0 auto;
}

.provider-btn span {
    line-height: 1;
}

/* ---- "Need help" link ---- */
form .form-help {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: clamp(24px, 6vw, 44px);
}

.form-help a {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ly-green-dark);
    padding: 8px 16px;
    border-radius: 8px;
}

    .form-help a:hover {
        color: var(--ly-green-darker);
        background: var(--ly-green-soft);
        text-decoration: none;
    }

/* ---- Footer attribution ---- */
.bottom-logo {
    width: 96px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: clamp(1.4rem, 5vw, 2.2rem) auto 0;
    opacity: 0.85;
}

.provider-text {
    text-align: center;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--ly-muted);
    letter-spacing: 0.2px;
    line-height: 1.5;
}

/* ---- Help modal (opened via inline display:block from Login.cshtml) ---- */
.help-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(9, 15, 20, 0.55);
    padding: 20px;
    overflow: auto;
}

.help-modal-content {
    background: #ffffff;
    margin: 10vh auto 0;
    padding: clamp(22px, 5vw, 30px);
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    border-top: 4px solid var(--ly-green);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    animation: card-in 0.3s ease both;
}

    .help-modal-content h3 {
        font-family: var(--font-head);
        color: var(--ly-ink);
    }

.help-email {
    color: var(--ly-green-dark);
    font-weight: 700;
    font-size: 1.1rem;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

    .close-modal:hover,
    .close-modal:focus {
        color: #000;
    }

/* ---- Small phones ---- */
@media (max-width: 480px) {
    .form-wrapper {
        border-radius: 14px;
    }

    .lyngson-accent {
        width: 72px;
    }
}

/* ---- Respect reduced-motion preference ---- */
@media (prefers-reduced-motion: reduce) {
    .form-wrapper,
    .help-modal-content {
        animation: none;
    }
}
