/* Manrope (SIL Open Font License 1.1, fonts/OFL.txt), served from here: no request to Google Fonts, no visitor IP sent to Google. */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../fonts/manrope-cyrillic-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../fonts/manrope-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../fonts/manrope-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* =============================================
   SkyAgro - same palette as skyagro.no and the cabinet (leaf / cream / gold)
   ============================================= */

:root {
    --sa-bg: #f6f3ec;
    --sa-panel: #fdfaf3;
    --sa-panel-2: #ffffff;
    --sa-border: rgba(41, 38, 27, 0.14);
    --sa-text: #29261b;
    --sa-muted: rgba(41, 38, 27, 0.62);
    --sa-leaf: #0f1d16;
    --sa-leaf-500: #2a6243;
    --sa-accent: #c8a961;
    --sa-accent-deep: #86692c;
    --sa-accent-ink: #0f1d16;
    --sa-danger: #b5412f;
}

html {
    font-size: 16px;
    position: relative;
    min-height: 100%;
}

body {
    background:
        radial-gradient(1100px 480px at 50% -12%, rgba(42, 98, 67, 0.16), transparent 70%),
        radial-gradient(900px 400px at 100% 110%, rgba(200, 169, 97, 0.16), transparent 70%),
        var(--sa-bg);
    font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
    color: var(--sa-text);
    position: relative;
}

/* =============================================
   Wordmark
   ============================================= */

.sa-wordmark {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 1.75rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--sa-leaf);
}

.sa-wordmark span {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sa-accent-deep);
}

.sa-brand-icon {
    flex-shrink: 0;
    color: var(--sa-accent);
    background: var(--sa-leaf);
    border-radius: 10px;
    padding: 6px;
}

a.sa-wordmark:hover {
    text-decoration: none;
    color: var(--sa-leaf);
}

/* =============================================
   Auth card
   ============================================= */

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--sa-panel);
    border: 1px solid var(--sa-border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 1px 2px rgba(15, 29, 22, 0.04), 0 12px 36px rgba(15, 29, 22, 0.08);
}

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--sa-leaf);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sa-accent);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sa-text);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--sa-muted);
}

.text-muted {
    color: var(--sa-muted) !important;
}

/* =============================================
   Form controls
   ============================================= */

.form-control {
    border-radius: 8px;
    background-color: var(--sa-panel-2);
    border-color: var(--sa-border);
    color: var(--sa-text);
    padding: 0.6rem 0.875rem;
    font-size: 0.9375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control::placeholder {
    color: rgba(41, 38, 27, 0.38);
}

.form-control:focus {
    background-color: var(--sa-panel-2);
    color: var(--sa-text);
    border-color: var(--sa-leaf-500);
    box-shadow: 0 0 0 3px rgba(42, 98, 67, 0.16);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sa-text);
    margin-bottom: 0.375rem;
}

.form-check-input {
    background-color: var(--sa-panel-2);
    border-color: var(--sa-border);
}

.form-check-input:checked {
    background-color: var(--sa-leaf-500);
    border-color: var(--sa-leaf-500);
}

/* =============================================
   Buttons
   ============================================= */

.btn-primary {
    background-color: var(--sa-accent);
    border-color: var(--sa-accent);
    color: var(--sa-accent-ink);
    border-radius: 8px;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 0.65rem 1rem;
    transition: background-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #d6bb7a !important;
    border-color: #d6bb7a !important;
    color: var(--sa-accent-ink) !important;
    box-shadow: 0 4px 16px rgba(134, 105, 44, 0.28);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border: 1px solid var(--sa-border);
    background: var(--sa-panel-2);
    color: var(--sa-text);
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-social:hover {
    background-color: var(--sa-bg);
    border-color: rgba(41, 38, 27, 0.28);
    color: var(--sa-text);
}

/* =============================================
   Divider
   ============================================= */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--sa-muted);
    font-size: 0.8rem;
}

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

/* =============================================
   Links
   ============================================= */

a {
    color: var(--sa-leaf-500);
    text-decoration: none;
}

a:hover {
    color: var(--sa-leaf);
    text-decoration: underline;
}

.auth-footer-link {
    font-size: 0.875rem;
    color: var(--sa-muted);
    text-align: center;
    margin-top: 1.25rem;
}

/* =============================================
   Language switcher
   ============================================= */

/* One small chip (globe + current code) whatever the number of languages; the native <select>
   lies over it invisibly, so the browser's own picker opens (a wheel/sheet on phones). */
.lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}

.lang-switcher__control {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    margin: 0;
    padding: 0.4rem 0.7rem;
    background: var(--sa-panel);
    border: 1px solid var(--sa-border);
    border-radius: 8px;
    color: var(--sa-muted);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.lang-switcher__control:hover {
    color: var(--sa-text);
    background-color: var(--sa-panel-2);
    border-color: rgba(41, 38, 27, 0.28);
}

.lang-switcher__control:focus-within {
    color: var(--sa-text);
    border-color: var(--sa-leaf-500);
    box-shadow: 0 0 0 3px rgba(42, 98, 67, 0.16);
}

.lang-switcher__globe,
.lang-switcher__caret {
    flex-shrink: 0;
}

.lang-switcher__caret {
    opacity: 0.7;
}

.lang-switcher__code {
    color: var(--sa-accent-deep);
}

/* The opened menu: drawn by us, not the browser, so every language gets room to breathe */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu[open] > summary { color: var(--sa-text); border-color: var(--sa-accent); }
.lang-menu[open] .lang-switcher__caret { transform: rotate(180deg); }
.lang-menu__list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: max-content;
    max-height: min(80vh, 40rem);
    overflow-y: auto;
    padding: 0.25rem;
    background: var(--sa-panel);
    border: 1px solid var(--sa-border);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 29, 22, 0.16);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.lang-menu__item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sa-text);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.lang-menu__item:hover, .lang-menu__item:focus-visible { background: var(--sa-bg); outline: none; }
/* the chosen language: by colour alone */
.lang-menu__item.is-current { background: rgba(200, 169, 97, 0.18); color: var(--sa-accent-deep); font-weight: 800; }

/* =============================================
   Alerts
   ============================================= */

.alert {
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(181, 65, 47, 0.08);
    border-color: rgba(181, 65, 47, 0.35);
    color: #8a2f21;
}

.alert-success {
    background: rgba(42, 98, 67, 0.08);
    border-color: rgba(42, 98, 67, 0.3);
    color: #1f432f;
}

.alert-info {
    background: rgba(200, 169, 97, 0.14);
    border-color: rgba(200, 169, 97, 0.45);
    color: #5f4a1f;
}

.text-danger {
    color: var(--sa-danger) !important;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* =============================================
   Footer
   ============================================= */

.sa-footer {
    border-top: 1px solid var(--sa-border);
    color: var(--sa-muted);
}

.sa-information {
    max-width: 760px;
    overflow-wrap: anywhere;
    line-height: 1.65;
}

.sa-information h2 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.sa-information li + li {
    margin-top: .75rem;
}

/* =============================================
   Responsive — mobile
   ============================================= */

/* Cards never touch the screen edges on tablets; long words (German compounds, emails) wrap
   instead of widening the page. */
.auth-body main {
    padding-left: 1rem;
    padding-right: 1rem;
}

.auth-card {
    overflow-wrap: break-word;
}

.sa-footer {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Each footer link wraps as a whole instead of breaking mid-phrase */
.sa-footer nav a {
    display: inline-block;
}

@media (max-width: 700px) {
    .auth-body main {
        align-items: flex-start !important;
        padding-top: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    /* The switcher joins the flow above the wordmark instead of floating over it */
    .lang-switcher {
        position: static;
        align-self: flex-end;
        margin: 0.75rem 1rem 0;
    }

    .sa-wordmark {
        padding-top: 0.5rem;
    }

    .auth-body main {
        padding-left: 0;
        padding-right: 0;
    }

    .auth-card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
        padding: 1.75rem 1.25rem;
    }

    .auth-title {
        font-size: 1.375rem;
    }

    /* 16px inputs stop iOS Safari from zooming the page on focus */
    .form-control {
        font-size: 1rem;
    }

    .btn-primary,
    .btn-social {
        min-height: 2.75rem;
    }

    #external-account .d-flex {
        flex-wrap: wrap;
    }

    .sa-information {
        line-height: 1.6;
    }

    .sa-information ol {
        padding-left: 1.25rem;
    }
}

/* =============================================
   Demo account hint
   ============================================= */

.demo-hint {
    padding: 0.75rem 0.9rem;
    margin-bottom: 1.25rem;
    border-radius: 10px;
    background: rgba(200, 169, 97, 0.14);
    border: 1px solid rgba(200, 169, 97, 0.45);
    color: #5f4a1f;
    font-size: 0.85rem;
    line-height: 1.45;
}

.demo-hint strong {
    display: block;
    color: var(--sa-text);
}
