/* ==========================================================================
   Aster – base condivisa (login, tutorial)
   Le variabili sono allineate a dist/css/pages/home.css
   ========================================================================== */

:root {
    --c-primary:      #0275d8;
    --c-primary-lt:   #3a9af5;
    --c-primary-dk:   #0056a3;
    --c-accent:       #00d4ff;
    --c-success:      #28c76f;
    --c-danger:       #e53e3e;
    --c-bg:           #080f26;
    --glass-bg:       rgba(255,255,255,0.055);
    --glass-border:   rgba(255,255,255,0.11);
    --glass-shadow:   0 12px 40px rgba(0,0,0,0.45);
    --text-pri:       #ffffff;
    --text-sec:       rgba(255,255,255,0.62);
    --r-card:         22px;
    --r-btn:          13px;
    --ease:           cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 16px; }

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--c-bg);
    overflow-x: hidden;
}

/* ===== Sfondo animato ===== */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 90% 70% at 15% 5%,  rgba(2,117,216,.20) 0%, transparent 60%),
        radial-gradient(ellipse 70% 60% at 85% 95%, rgba(0,212,255,.12) 0%, transparent 55%),
        linear-gradient(155deg, #080f26 0%, #0c1a4a 55%, #060d1e 100%);
    animation: bgPulse 14s ease-in-out infinite alternate;
}
@keyframes bgPulse {
    0%   { opacity: 1; }
    100% { opacity: .82; }
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .13;
    pointer-events: none;
    z-index: 0;
}
.orb-1 { width: 420px; height: 420px; background: #0275d8; top: -130px; left: -130px;
         animation: orbDrift 20s ease-in-out infinite; }
.orb-2 { width: 320px; height: 320px; background: #00d4ff; bottom: -90px; right: -90px;
         animation: orbDrift 17s ease-in-out infinite reverse; }
.orb-3 { width: 260px; height: 260px; background: #6c63ff; top: 38%; left: 58%;
         animation: orbDrift 23s ease-in-out infinite; animation-delay: -8s; }
@keyframes orbDrift {
    0%,100% { transform: translate(0,0)        scale(1);   }
    33%     { transform: translate(28px,-22px) scale(1.06); }
    66%     { transform: translate(-18px,26px) scale(.95); }
}

/* ===== Preloader ===== */
.preloader {
    position: fixed; inset: 0;
    background: var(--c-bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity .5s, visibility .5s;
}
.loader { text-align: center; }
.loader__figure {
    width: 48px; height: 48px;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin .85s linear infinite;
    margin: 0 auto 14px;
}
.loader__label {
    color: var(--text-sec);
    font-size: .78rem;
    letter-spacing: 4px;
    text-transform: uppercase;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Animazioni comuni ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}
@keyframes cardUp {
    from { opacity: 0; transform: translateY(44px) scale(.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes logoGlow {
    from { filter: drop-shadow(0 4px 12px rgba(2,117,216,.3)); }
    to   { filter: drop-shadow(0 6px 26px rgba(0,212,255,.55)); }
}

/* ===== Layout ===== */
#main {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    padding: 24px 16px 40px;
}

/* ===== Card glass ===== */
.af-card {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-card);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.07);
    animation: cardUp .65s cubic-bezier(.34,1.56,.64,1) both;
    overflow: hidden;
}
.card-inner { padding: 30px 22px 26px; }

/* ===== Separatore ===== */
.sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin: 0 -22px 22px;
}

/* ===== Bottoni ===== */
.af-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: var(--r-btn);
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.af-btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
    opacity: 0;
    transition: opacity .25s;
}
.af-btn:hover::after { opacity: 1; }
.af-btn:hover        { transform: translateY(-2px); }
.af-btn:active       { transform: translateY(0); }
.af-btn[hidden]      { display: none; }

.af-btn-primary {
    background: linear-gradient(135deg, var(--c-primary-dk), var(--c-primary));
    color: #fff;
    box-shadow: 0 4px 18px rgba(2,117,216,.38);
}
.af-btn-primary:hover { box-shadow: 0 8px 26px rgba(2,117,216,.55); }

.af-btn-accent {
    background: linear-gradient(135deg, #0283f0, #00c4e8);
    color: #fff;
    box-shadow: 0 5px 22px rgba(0,180,220,.42);
    font-size: .97rem;
    padding: 16px 18px;
}
.af-btn-accent:hover { box-shadow: 0 9px 32px rgba(0,180,220,.62); }

.af-btn-ghost {
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.13);
    color: var(--text-sec);
    box-shadow: none;
}
.af-btn-ghost:hover { background: rgba(255,255,255,.09); box-shadow: 0 4px 16px rgba(0,0,0,.2); }

/* ===== Input ===== */
.input-wrap { position: relative; }
.input-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.35);
    font-size: .88rem;
    pointer-events: none;
    transition: color .3s;
}
.af-input {
    width: 100%;
    padding: 13px 14px 13px 40px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.11);
    border-radius: var(--r-btn);
    color: var(--text-pri);
    font-size: .93rem;
    transition: border-color .3s, background .3s, box-shadow .3s;
    -webkit-appearance: none;
    appearance: none;
}
.af-input::placeholder { color: rgba(255,255,255,.3); }
.af-input:focus {
    outline: none;
    border-color: var(--c-primary);
    background: rgba(255,255,255,.085);
    box-shadow: 0 0 0 3px rgba(2,117,216,.2);
}
.input-wrap:focus-within .input-icon { color: var(--c-primary); }

/* ===== Box informativo ===== */
.af-note {
    background: rgba(2,117,216,.09);
    border-left: 3px solid rgba(2,117,216,.55);
    border-radius: 0 9px 9px 0;
    padding: 10px 13px;
    font-size: .8rem;
    color: var(--text-sec);
    line-height: 1.6;
}
.af-note i { color: var(--c-primary); margin-right: 5px; }
.af-note a { color: var(--c-primary-lt); text-decoration: underline; }
.af-note a:hover { color: var(--c-accent); }
.af-note.is-success { background: rgba(40,199,111,.09); border-left-color: rgba(40,199,111,.55); }
.af-note.is-success i { color: var(--c-success); }

/* ===== Spaziature ===== */
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 24px; }
