/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #09090f;
}

/* ── Animated mesh gradient background ── */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99,102,241,.55) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(139,92,246,.45) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(16,185,129,.15) 0%, transparent 70%),
        #09090f;
}

/* ── Floating particles ── */
.particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.p {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    animation: rise linear infinite;
}
@keyframes rise {
    from { transform: translateY(110vh) scale(1); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: .5; }
    to   { transform: translateY(-10vh) scale(1.4); opacity: 0; }
}

/* ── Glass card ── */
.card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    margin: 20px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow:
        0 0 0 1px rgba(99,102,241,.15),
        0 32px 64px rgba(0,0,0,.6),
        inset 0 1px 0 rgba(255,255,255,.12);
    padding: 44px 40px 40px;
    animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both;
    position:absolute;
    top:10vh;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(32px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    border-radius: 50%;
}

/* ── Logo ── */
.logo { display: flex; flex-direction: column; align-items: center; margin-bottom:16px; text-align: center; }
.logo-icon {
    width: 64px; height: 64px;
    border-radius: 0px;
    background-image: url('/img/logo_128.png');
    background-size: cover;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.logo-name  { font-size: 1.2rem; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.logo-tag   { font-size: .75rem; color: rgba(255,255,255,.45); margin-top: 3px; font-weight: 500; }

/* ── Fields ── */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .76rem; font-weight: 600; color: rgba(255,255,255,.7); margin-bottom: 7px; letter-spacing: .01em; }
.input-wrap { position: relative; }
.input-wrap i.icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,.35); font-size: .8rem;
    pointer-events: none; transition: color .2s;
}
.input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.12);
    border-radius: 11px;
    color: #fff; font-size: .88rem;
    font-family: inherit; outline: none;
    transition: all .22s;
}
.input-wrap input::placeholder { color: rgba(255,255,255,.3); }
.input-wrap input:focus {
    background: rgba(255,255,255,.12);
    border-color: rgba(99,102,241,.7);
    box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.input-wrap input:focus ~ i.icon { color: rgba(99,102,241,.9); }
.eye {
    position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,.3); font-size: .8rem;
    cursor: pointer; transition: color .2s;
}
.eye:hover { color: rgba(255,255,255,.7); }

/* ── Bottom row ── */
.bottom-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 22px; }
.check-label {
    display: flex; align-items: center; gap: 7px;
    font-size: .77rem; color: rgba(255,255,255,.6); cursor: pointer;
}
.check-label input[type=checkbox] { accent-color: #6366f1; width: 15px; height: 15px; cursor: pointer; }
.forgot-link { font-size: .77rem; font-weight: 500; color: rgba(99,102,241,.9); text-decoration: none; transition: color .2s; }
.forgot-link:hover { color: #a5b4fc; }

/* ── Login button ── */
.btn-login {
    width: 100%; padding: 13.5px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff; border: none; border-radius: 11px;
    font-size: .92rem; font-weight: 700; font-family: inherit;
    cursor: pointer; position: relative;
    box-shadow: 0 6px 20px rgba(99,102,241,.4);
    transition: all .22s;
}
.btn-login:hover  { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(99,102,241,.5); }
.btn-login:active { transform: translateY(0); }
.btn-login.loading { color: transparent; pointer-events: none; }
.btn-login.loading::after {
    content: ''; position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 18px;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255,255,255,.25);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error alert ── */
.login-error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.3);
    color: #fca5a5;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .8rem;
    margin-bottom: 16px;
    display: none;
}
.login-error.show { display: block; }

/* ── Footer ── */
.card-footer-txt { text-align: center; margin-top: 24px; font-size: .71rem; color: rgba(255,255,255,.25); }

/* ── Language selector ── */
.lang-bar { position: fixed; top: 18px; right: 20px; z-index: 100; display: flex; gap: 6px; }
.lang-btn {
    padding: 6px 12px; border-radius: 8px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.75);
    font-size: .72rem; font-weight: 600;
    cursor: pointer; transition: all .18s;
    display: flex; align-items: center; gap: 6px;
}
.lang-btn .fi { width: 20px; height: 14px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.lang-btn.active, .lang-btn:hover {
    background: rgba(99,102,241,.25);
    border-color: rgba(99,102,241,.5);
    color: #fff;
}
