/* Login with the 3D globe (Pages/IndexGlobe.cshtml). Self-contained: no bootstrap on this page. */

@font-face { font-family: "Cerebri Sans"; src: url("../fonts/cerebrisans/cerebrisans-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cerebri Sans"; src: url("../fonts/cerebrisans/cerebrisans-medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cerebri Sans"; src: url("../fonts/cerebrisans/cerebrisans-semibold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cerebri Sans"; src: url("../fonts/cerebrisans/cerebrisans-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
    --brand: #2c7be5;
    --brand-dark: #1a68d1;
    --brand-light: #a6c5f7;
    --ink: #12263f;
    --muted: #6e84a3;
    --line: #dce5f1;
    --danger: #e63757;
    --sky-top: #f7faff;
    --sky-bottom: #dfeaf8;
    --card: rgba(255, 255, 255, .9);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: "Cerebri Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: radial-gradient(ellipse at 65% 45%, #ffffff 0%, var(--sky-top) 35%, var(--sky-bottom) 100%);
    border-top: 3px solid var(--brand);
    overflow: hidden;
}

/* starry sky: the stars are the globe.gl background image; without the globe (no WebGL)
   login-globe.js removes the class and the light gradient above stays */
body.sfondo-stelle { background: #03060d; }
body.sfondo-stelle .login { background: rgba(255,255,255,.97); }
body.sfondo-stelle .attrib, body.sfondo-stelle .attrib a { color: rgba(255,255,255,.55); }

/* --- globe --- */
#globo { position: absolute; inset: 0; z-index: 0; isolation: isolate; }   /* markers always below the login card */
#globo canvas { outline: none; }
.sede {
    width: 12px; height: 12px; left: -6px; top: -6px; border-radius: 50%; z-index: 10;
    background: #2c7be5; border: 2.5px solid #fff; box-shadow: 0 0 0 4px rgba(44,123,229,.25); pointer-events: none;
}
/* the sun: glow over the globe, positioned by login-globe.js (visible only towards the night side) */
.sole {
    position: absolute; left: 0; top: 0; z-index: 1; width: 220px; height: 220px;
    border-radius: 50%; pointer-events: none; opacity: 0; will-change: transform, opacity;
    background: radial-gradient(circle, #fff 0 3%, rgba(255,250,228,.95) 6%, rgba(255,228,150,.55) 14%,
                rgba(255,195,95,.18) 32%, rgba(255,170,60,0) 60%);
    mix-blend-mode: screen;
}
.attrib { position: absolute; right: 8px; bottom: 6px; z-index: 2; font-size: 10px; color: var(--muted); }
/* FPS counter, only with ?fps=1 (login-globe.js) */
.fps {
    position: fixed; z-index: 6; top: 8px; left: 8px; padding: 4px 8px; border-radius: 6px;
    font: 600 12px/1.3 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums;
    color: #fff; background: rgba(0,0,0,.6); pointer-events: none;
}
.fps ~ .fps { top: 36px; }                 /* ?fps=1, ?luglio=1, ?ora=... together: one box below the other */
.fps ~ .fps ~ .fps { top: 64px; }
/* the moon: disc with its phase, drawn and positioned by login-globe.js */
.luna {
    position: absolute; left: 0; top: 0; z-index: 1; opacity: 0;
    pointer-events: none; will-change: transform, opacity;
}
.attrib a { color: var(--muted); }

/* --- login card --- */
.login {
    position: absolute; bottom: 32px; left: 32px; z-index: 2;
    width: 360px; max-height: calc(100% - 48px); overflow-y: auto;
    padding: 32px 32px 24px;
    background: var(--card);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 14px;
    box-shadow: 0 18px 50px -12px rgba(18, 38, 63, .25), 0 2px 6px rgba(18, 38, 63, .06);
}
.login .logo { display: block; width: 92px; margin-bottom: 22px; }
.login h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.login .intro { margin: 0 0 24px; color: var(--muted); font-size: 15px; }
.login form { margin: 0; }

.field { margin-bottom: 16px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.login label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input {
    width: 100%; height: 42px; padding: 0 12px;
    font: inherit; font-size: 15px; color: var(--ink);
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #a9b8cc; }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(44,123,229,.18); }
.field input.input-validation-error { border-color: var(--danger); }

/* password with show/hide */
.pwd { position: relative; }
.pwd input { padding-right: 42px; }
.pwd-toggle {
    position: absolute; top: 0; right: 0; width: 42px; height: 42px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 0 8px 8px 0; color: var(--muted); cursor: pointer;
}
.pwd-toggle:hover { color: var(--ink); }
.pwd-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pwd-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pwd-toggle .eye-off, .pwd-toggle.on .eye { display: none; }
.pwd-toggle.on .eye-off { display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.small { font-size: 13px; }

.login .remember { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin: 4px 0 20px; cursor: pointer; }
.remember input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }

.submit {
    width: 100%; height: 44px; border: 0; border-radius: 8px;
    font: inherit; font-size: 15px; font-weight: 600; color: #fff;
    background: var(--brand); cursor: pointer; transition: background .15s;
}
.submit:hover { background: var(--brand-dark); }
.submit:focus-visible { outline: 3px solid rgba(44,123,229,.35); outline-offset: 2px; }

.signup { text-align: center; color: var(--muted); font-size: 14px; margin: 18px 0 0; }

/* errors: validation summary (wrong credentials, cookies not accepted) and field messages */
.errors ul { margin: 0 0 16px; padding: 10px 12px; list-style: none; font-size: 14px; color: var(--danger);
             background: rgba(230,55,87,.08); border: 1px solid rgba(230,55,87,.25); border-radius: 8px; }
.validation-summary-valid { display: none; }
.field-error { display: block; font-size: 13px; color: var(--danger); margin-top: 4px; }
.field-error:empty { display: none; }

/* language: CulturePicker view component (form > div > select#culture-picker) */
.lang form { margin: 18px 0 0; text-align: center; }
.lang select {
    padding: 4px 8px; max-width: 100%;
    font: inherit; font-size: 13px; color: var(--muted);
    background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.lang select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* cookie consent (_CookieConsentPartial, built for bootstrap): top right, away from the login card at the bottom */
#cookieConsent {
    position: fixed; z-index: 5; top: 16px; right: 16px;
    width: min(520px, calc(100% - 32px)); margin: 0; padding: 12px 16px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 14px; color: var(--ink);
    background: rgba(255,255,255,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.8); border-radius: 10px;
    box-shadow: 0 10px 30px -10px rgba(18,38,63,.35);
}
#cookieConsent button {
    margin-left: auto; padding: 6px 14px; border: 0; border-radius: 6px;
    font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: var(--brand); cursor: pointer;
}
#cookieConsent button:hover { background: var(--brand-dark); }

@media (max-width: 720px) {
    .login { bottom: 16px; left: 16px; right: 16px; width: auto; max-height: calc(100% - 32px); padding: 24px 22px 18px; }
    .login .logo { width: 72px; margin-bottom: 14px; }
}
@media (max-height: 640px) and (min-width: 721px) { .login { bottom: 16px; max-height: calc(100% - 32px); padding-top: 22px; } }
