/* Sign-in page (index.php). Page-specific styles only. */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #0b1829;
    --ink-mid: #3d526b;
    --ink-soft: #7a8fa8;
    --ink-ghost: #b4c1d4;
    --surface: #ffffff;
    --bg: #f0f3f9;
    --line: #dde3ee;
    --orange: #f97316;
    --blue: #1a56db;
    --blue-dim: #dce9ff;
    --r-card: 28px;
    --r-btn: 14px;
    --r-chip: 100px;
    --transition-smooth: cubic-bezier(0.65, 0, 0.35, 1);
}

html,
body {
    height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    /* background:linear-gradient(90deg, rgb(209, 208, 233) 0%, rgb(198, 237, 238) 35%, rgb(230 207 239 / 23%) 100%); */
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: var(--ink);
    overflow: hidden;
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0;
    animation: fadeInParticles 1.2s var(--transition-smooth) forwards;
}

@keyframes fadeInParticles {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* ── page layout ── */
.scene {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 1.5rem 1.25rem;
    display: grid;
    place-items: center;
}

/* ── column: card + powered-by + footer ── */
.column {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── card animation wrapper ── */
.card-wrapper {
    width: 100%;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    animation: cardEntrance 0.9s var(--transition-smooth) forwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── card ── */
.card {
    width: 100%;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: var(--r-card);
    border: 1px solid rgba(221, 227, 238, 0.9);
    box-shadow:
        0 2px 4px rgba(11, 24, 41, 0.04),
        0 8px 24px rgba(11, 24, 41, 0.07),
        0 32px 64px rgba(11, 24, 41, 0.08);
    overflow: hidden;
}

.card-stripe {
    height: 4px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--orange) 100%);
    transform: scaleX(0);
    transform-origin: left;
    animation: stripeExpand 1.2s var(--transition-smooth) 0.3s forwards;
}

@keyframes stripeExpand {
    0% {
        transform: scaleX(0);
    }

    100% {
        transform: scaleX(1);
    }
}

.card-body {
    padding: 2.5rem 2.75rem 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ── logo animation ── */
.logo-icon {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    margin-bottom: 1.2rem;
    box-shadow:
        0 0 0 3px rgba(26, 86, 219, 0.10),
        0 4px 16px rgba(11, 24, 41, 0.10);
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.5);
    animation: logoPop 0.7s var(--transition-smooth) 0.2s forwards;
}

@keyframes logoPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    70% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── brand animation ── */
.brand-label {
    font-family: 'Arvo', serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 1.4rem;
    opacity: 0;
    transform: translateY(10px);
    animation: slideUpFade 0.6s var(--transition-smooth) 0.3s forwards;
}

.brand-label em {
    font-style: normal;
    color: var(--orange);
}

/* ── headline animation ── */
.headline {
    font-family: 'Arvo', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 0.45rem;
    opacity: 0;
    transform: translateY(10px);
    animation: slideUpFade 0.6s var(--transition-smooth) 0.4s forwards;
}

.subline {
    font-size: 15px;
    font-weight: 400;
    color: var(--ink-mid);
    line-height: 1.55;
    margin-bottom: 2rem;
    max-width: 275px;
    opacity: 0;
    transform: translateY(10px);
    animation: slideUpFade 0.6s var(--transition-smooth) 0.5s forwards;
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── alerts animation ── */
.alert {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-align: left;
    opacity: 0;
    transform: translateX(-10px);
    animation: alertSlideIn 0.5s var(--transition-smooth) 0.6s forwards;
}

@keyframes alertSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.alert-info {
    background: var(--blue-dim);
    color: #1a3a72;
    border: 1px solid rgba(26, 86, 219, .18);
}

.alert-success {
    background: #eafaf2;
    color: #0e5c36;
    border: 1px solid rgba(22, 163, 74, .18);
}

/* ── google btn animation ── */
.g-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--r-btn);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .15s;
    box-shadow: 0 1px 3px rgba(11, 24, 41, .06);
    opacity: 0;
    transform: translateY(15px);
    animation: buttonRise 0.6s var(--transition-smooth) 0.7s forwards;
}

@keyframes buttonRise {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.g-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 86, 219, .04), rgba(249, 115, 22, .04));
    opacity: 0;
    transition: opacity .2s;
}

.g-btn:hover {
    border-color: var(--ink-ghost);
    box-shadow: 0 4px 16px rgba(11, 24, 41, .10);
    transform: translateY(-1.5px);
}

.g-btn:hover::after {
    opacity: 1;
}

.g-btn:active {
    transform: none;
    box-shadow: none;
}

.g-logo {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    animation: googleIconSpin 0.8s var(--transition-smooth) 0.9s both;
}

@keyframes googleIconSpin {
    0% {
        transform: rotate(0deg) scale(0.5);
        opacity: 0;
    }

    70% {
        transform: rotate(360deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

/* ── trust chips animation ── */
.trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.35rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeIn 0.8s var(--transition-smooth) 0.9s forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.77rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 0.27rem 0.72rem;
    border-radius: var(--r-chip);
    transform: scale(1);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.chip:hover {
    transform: scale(1.05);
    background: #e8ecf5;
}

/* ── divider ── */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 1.5rem 0;
    opacity: 0;
    animation: slideUpFade 0.6s var(--transition-smooth) 0.8s forwards;
}

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

.divider span {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink-ghost);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* ── ID/password button ── */
.idpw-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem 1.5rem;
    background: var(--ink);
    border: 1.5px solid var(--ink);
    border-radius: var(--r-btn);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background .2s, border-color .2s, box-shadow .18s, transform .15s;
    box-shadow: 0 1px 3px rgba(11, 24, 41, .12);
    opacity: 0;
    transform: translateY(15px);
    animation: buttonRise 0.6s var(--transition-smooth) 0.9s forwards;
}

.idpw-btn:hover {
    background: #1a2e4a;
    border-color: #1a2e4a;
    box-shadow: 0 4px 16px rgba(11, 24, 41, .16);
    transform: translateY(-1.5px);
}

.idpw-btn:active {
    transform: none;
    box-shadow: none;
}

.idpw-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── login form panel ── */
.login-panel {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.16s ease-out, transform 0.16s ease-out;
}

.login-panel.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.form-field {
    width: 100%;
    text-align: left;
}

.form-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-mid);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.form-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
    background: #fff;
}

.form-field input.input-error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--blue) 0%, #2563eb 100%);
    border: none;
    border-radius: var(--r-btn);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.25);
    margin-top: 0.25rem;
}

.submit-btn:hover {
    box-shadow: 0 4px 18px rgba(26, 86, 219, 0.35);
    transform: translateY(-1.5px);
}

.submit-btn:active {
    transform: none;
    box-shadow: 0 1px 4px rgba(26, 86, 219, 0.15);
}

#totpPanel {
    width: 100%;
    align-items: stretch;
    gap: 1.15rem;
}

#totpPanel .subline,
.totp-subline {
    max-width: 22rem;
}

#totpForm,
#totpPanel form {
    width: 100%;
    margin: 0;
}

#totpForm {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

#totpForm .form-field {
    margin: 0;
}

#totpForm .submit-btn {
    width: 100%;
    box-sizing: border-box;
    margin: 1.15rem 0 0;
    padding: 0.95rem 1.5rem;
}

.totp-qr {
    display: flex;
    justify-content: center;
    align-self: center;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.totp-qr svg {
    width: 188px;
    height: 188px;
    display: block;
}

.totp-manual {
    margin: 0;
    font-size: 0.84rem;
    color: var(--ink-mid);
    line-height: 1.5;
    text-align: center;
}

.totp-manual code,
.totp-codes code {
    display: block;
    margin-top: 0.45rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink);
    word-break: break-word;
}

.totp-codes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.totp-codes li {
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.4rem;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin-top: 0.5rem;
    transition: color 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.back-link:hover {
    color: var(--blue);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

/* After "Back to all sign-in options", skip staggered delays (otherwise buttons stay invisible ~1s) */
#googleSection.google-reveal--instant .g-btn,
#googleSection.google-reveal--instant .g-logo,
#googleSection.google-reveal--instant .divider,
#googleSection.google-reveal--instant .idpw-btn {
    animation: none !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

#googleSection.google-reveal--instant .g-logo {
    transform: none !important;
}

.alert-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid rgba(229, 62, 62, .18);
}

.chip svg {
    width: 11px;
    height: 11px;
    color: var(--blue);
    flex-shrink: 0;
    animation: chipIconPulse 2s infinite ease-in-out;
}

@keyframes chipIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ink-ghost);
    flex-shrink: 0;
}

/* ── powered-by block animation ── */
.powered-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.4rem 0 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.8s var(--transition-smooth) 1s forwards;
}

.powered-label {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: black;
    position: relative;
    overflow: hidden;
}

.powered-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.viana-logo {
    width: 120px;
    height: 120px;
    border-radius: 11px;
    overflow: hidden;
    background: transparent;
    display: grid;
    place-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* .viana-logo:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
} */

.viana-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── bottom footer animation ── */
.bottom-footer {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 0 0;
    flex-wrap: wrap;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.8s var(--transition-smooth) 1.1s forwards;
}

.bottom-footer span {
    font-size: 0.72rem;
    color: black;
    position: relative;
}

.bottom-footer .dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: black;
    flex-shrink: 0;
}

.bottom-footer a {
    font-size: 0.72rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
    transition: color .15s;
    position: relative;
}

.bottom-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--blue);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.bottom-footer a:hover {
    color: var(--blue);
}

.bottom-footer a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ── loader ── */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(240, 243, 249, .88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 2000;
    display: grid;
    place-items: center;
    animation: fadeIn .2s ease both;
}

.loader-overlay.d-none {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.loader-box {
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2.25rem 3rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(11, 24, 41, .10);
    animation: loaderPop 0.5s var(--transition-smooth);
}

@keyframes loaderPop {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.spin {
    width: 38px;
    height: 38px;
    border: 2.5px solid var(--line);
    border-top-color: var(--orange);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-mid);
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ── toast ── */
.toast-wrap {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}

.toast {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(11, 24, 41, .10);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: toastIn 0.4s var(--transition-smooth) forwards;
    transform-origin: right;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.t-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

.t-body {
    flex: 1;
}

.t-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2px;
}

.t-msg {
    font-size: 0.81rem;
    color: var(--ink-mid);
    line-height: 1.4;
}

.t-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-ghost);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.t-close:hover {
    color: var(--ink);
    transform: scale(1.1);
}

/* ---- utilities replacing former inline style attributes ---- */
.u-center { text-align: center; }
.mt-field { margin-top: 0.75rem; }
.mt-submit { margin-top: 1rem; }
.field-inline { margin-top: 0.75rem; display: flex; align-items: center; gap: 8px; }
.field-inline input[type="checkbox"] { width: auto; }
.field-inline label { margin-bottom: 0; font-weight: normal; font-size: 0.9rem; cursor: pointer; }
.icon-gap { margin-right: 2px; }
.alert-soft { backdrop-filter: blur(5px); }
.alert-soft.alert-success { background: rgba(40, 167, 69, 0.1); color: #155724; }
.alert-soft.alert-warning { background: rgba(255, 193, 7, 0.1); color: #856404; }
.alert-soft.alert-danger { background: rgba(220, 53, 69, 0.1); color: #721c24; }
.alert-error[hidden] { display: none; }
