/*
 * mijn.silvasoft.nl — login, wachtwoord vergeten en feedback-login.
 * Een statische kopie van de Silvasoft NEXT-inlogpagina (frontend/src/components/auth/AuthLayout.tsx + AuthFormulier.tsx,
 * kleuren uit frontend/src/components/ui/tokens.ts). Pas daar iets aan, pas het hier ook aan.
 * Lettertypen: Open Sans en Space Grotesk (SIL Open Font License 1.1), dezelfde woff2-bestanden als NEXT.
 */

@font-face {
    font-family: "Open Sans";
    src: url("fonts/open-sans-latin.woff2") format("woff2");
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk-latin.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --font: "Open Sans", sans-serif;
    --font-display: "Space Grotesk", "Open Sans", sans-serif;
    --brand: #2563eb;
    --brand-hover: #1d4ed8;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --control-inactive: #d1d5db;
    --info-border: #93c5fd;
    --error-bg: #fef2f2;
    --error-text: #dc2626;
    --error-border: #fca5a5;
    --success-bg: #f0fdf4;
    --success-text: #16a34a;
    --success-border: #86efac;
    --canvas: #10192d;
    --canvas-text: #f4f7fb;
    --canvas-muted: #a9b4c7;
    --canvas-faint: #8a96ab;
    --logo-blue: #4f9fd7;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--text-primary);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

.auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}
@supports (min-height: 100dvh) {
    .auth { min-height: 100dvh; }
}

/* ── Brand panel ─────────────────────────────────────── */

.brand {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--canvas);
    color: var(--canvas-text);
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
}
.brand::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        radial-gradient(900px 520px at 18% -8%, rgba(79, 159, 215, 0.16), transparent 70%),
        radial-gradient(700px 400px at 100% 12%, rgba(79, 159, 215, 0.06), transparent 70%);
}

/* below 900px: one compact bar, logo and NEXT */
.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand-bar img { display: block; width: 118px; height: 20px; }
.brand-bar-next {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.brand-next {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.14em;
    color: var(--logo-blue);
}

.brand-logo,
.brand-mid,
.brand-copy { display: none; }

.brand-logo { width: 150px; height: 25px; }

.brand-mid {
    width: 100%;
    max-width: 460px;
    margin: auto 0;
    padding: 32px 0;
}
.tagline {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(46px, 4.6vw, 68px);
    line-height: 0.94;
    letter-spacing: -0.04em;
    color: var(--canvas-text);
}
.tagline-next {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--logo-blue);
}
.tagline-sub {
    margin: 24px 0 0;
    max-width: 38ch;
    font-size: 16px;
    line-height: 1.55;
    color: var(--canvas-muted);
}
.brand-copy {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--canvas-faint);
}

/* "Coming soon" next to Silvasoft NEXT: links to the teaser */
.soon {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid rgba(79, 159, 215, 0.45);
    border-radius: 999px;
    background: rgba(79, 159, 215, 0.1);
    font-family: var(--font);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--logo-blue);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.soon:hover {
    background: rgba(79, 159, 215, 0.2);
    border-color: var(--logo-blue);
    color: var(--canvas-text);
}
.soon:focus-visible {
    outline: 2px solid var(--logo-blue);
    outline-offset: 2px;
}
.tagline .soon {
    font-size: 12.5px;
    padding: 5px 12px;
    letter-spacing: 0.02em;
}
.brand-bar .soon {
    font-size: 10.5px;
    padding: 3px 8px;
}

/* Under "Silvasoft NEXT": the badge and a clear link to the teaser */
.soon-rij {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    letter-spacing: normal;
    line-height: 1.2;
}
span.soon:hover { background: rgba(79, 159, 215, 0.1); border-color: rgba(79, 159, 215, 0.45); color: var(--logo-blue); }
.teaser {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--canvas-faint);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--canvas-text);
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.teaser:hover { border-color: var(--logo-blue); background: rgba(79, 159, 215, 0.12); }
.teaser:focus-visible { outline: 2px solid var(--logo-blue); outline-offset: 2px; }

/* ── Form column ─────────────────────────────────────── */

.form-col {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 16px;
}
.form-wrap {
    width: 100%;
    max-width: 420px;
    animation: loginRise 0.35s ease-out both;
}
@keyframes loginRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .form-wrap { animation: none; }
}

.auth-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}
.auth-sub {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.auth-form { width: 100%; margin: 0; }
.auth-fields {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}
.label-row label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
}
.label-link {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--brand);
    text-decoration: none;
}
.label-link:hover { color: var(--brand-hover); }

.field-wrap { position: relative; }
.field {
    display: block;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--control-inactive);
    border-radius: 8px;
    background: #ffffff;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.4375;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.field:hover { border-color: var(--text-tertiary); }
.field:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.field::placeholder { color: var(--text-primary); opacity: 0.42; }
.field:disabled { background: #f9fafb; }
.field-pw { padding-right: 44px; }
.field::-ms-reveal { display: none; }

.eye {
    position: absolute;
    top: 50%;
    right: 11px;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    padding: 5px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.eye:hover { color: var(--text-secondary); background: rgba(0, 0, 0, 0.04); }
.eye:focus { outline: none; }
.eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.eye svg { width: 18px; height: 18px; fill: currentColor; }
.eye .eye-off { display: none; }
.eye.is-visible .eye-on { display: none; }
.eye.is-visible .eye-off { display: block; }

/* the messages login.js fills (display: block when there is text) */
.messagePane {
    position: relative;
    padding: 12px 12px 12px 37px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.messagePane::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 13px;
    width: 17px;
    height: 17px;
    background-repeat: no-repeat;
    background-size: 17px 17px;
}
.alert-danger {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}
.alert-danger::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23dc2626' d='M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8'/%3E%3C/svg%3E");
}
.alert-success {
    margin-top: 28px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}
.alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2316a34a' d='M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8'/%3E%3C/svg%3E");
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin-top: 4px;
    padding: 6px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #ffffff;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.75;
    cursor: pointer;
    transition: background-color 0.25s, box-shadow 0.25s;
}
.auth-btn:hover { background: var(--brand-hover); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25); }
.auth-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.auth-btn:disabled { background: var(--info-border); box-shadow: none; cursor: default; }
.auth-btn svg { width: 20px; height: 20px; margin: 0 8px 0 -4px; fill: currentColor; flex-shrink: 0; }
.auth-btn .spinner {
    display: none;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.auth-btn.is-busy svg { display: none; }
.auth-btn.is-busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-foot {
    margin: 24px 0 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    color: var(--text-secondary);
}
.auth-foot a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.auth-foot a:hover { color: var(--brand-hover); }

/* ── Breakpoints (MUI: sm 600, md 900, lg 1200) ───────── */

@media (min-width: 600px) {
    .form-col { padding-left: 32px; padding-right: 32px; }
}

@media (min-width: 900px) {
    .auth { flex-direction: row; }
    .brand {
        flex: 0 0 46%;
        padding: 56px 32px;
    }
    .brand-bar { display: none; }
    .brand-logo, .brand-mid, .brand-copy { display: block; }
    .form-col {
        justify-content: center;
        padding-top: 64px;
        padding-bottom: 64px;
    }
}

@media (min-width: 1200px) {
    .brand { padding-left: 72px; padding-right: 72px; }
}
