*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cyan: #3ECFCF;
    --blue: #4DA6FF;
    --teal: #2BB5B5;
    --dark: #2C2C3E;
    --mid: #4A4A6A;
    --light: #F0F4FF;
    --white: #FFFFFF;
    --grad: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
}

html, body {
    height: 100%;
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
}

/* ─── BACKGROUND ─────────────────────────────────────────── */
.bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #49aff4 0%, #05346b 40%, #051f6b 100%);
    z-index: 0;
}

    .bg::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse 70% 60% at 10% 20%, rgba(77,166,255,.18) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 90% 80%, rgba(62,207,207,.18) 0%, transparent 60%);
    }
/* Floating circles */
.bubble {
    position: absolute;
    border-radius: 50%;
    opacity: .08;
    animation: drift linear infinite;
}

.b1 {
    width: 360px;
    height: 360px;
    background: var(--blue);
    top: -80px;
    left: -80px;
    animation-duration: 20s;
}

.b2 {
    width: 240px;
    height: 240px;
    background: var(--cyan);
    bottom: -60px;
    right: -40px;
    animation-duration: 25s;
}

.b3 {
    width: 160px;
    height: 160px;
    background: var(--teal);
    top: 50%;
    left: 5%;
    animation-duration: 18s;
}

.b4 {
    width: 100px;
    height: 100px;
    background: var(--blue);
    top: 20%;
    right: 10%;
    animation-duration: 22s;
}

@keyframes drift {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* ─── STAGE ──────────────────────────────────────────────── */
.stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── CARD ───────────────────────────────────────────────── */
.card {
    width: 420px;
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    padding: 48px 44px;
    box-shadow: 0 32px 80px rgba(0,0,0,.45);
    position: relative;
    overflow: hidden;
}

    .card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--grad);
        border-radius: 28px 28px 0 0;
    }

/* ─── SCREEN TRANSITIONS ─────────────────────────────────── */
.screen {
    position: absolute;
    inset: 0;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity .5s ease, transform .5s ease;
}

    .screen.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }

    .screen.exit {
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none;
    }
/* Keep card height stable */
.card {
    min-height: 610px;
    padding: 0;
}

/* ─── LOGO ───────────────────────────────────────────────── */
.logo-wrap {
    text-align: center;
    margin-bottom: 28px;
}

.logo-icon {
    display: inline-block;
    margin-bottom: 12px;
}
/* SVG logo inline recreation */
.logo-svg {
    width: 72px;
    height: 72px;
}

.logo-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -.5px;
}

    .logo-name span {
        color: var(--cyan);
    }

.logo-tagline {
    font-size: .82rem;
    color: rgba(255,255,255,.55);
    margin-top: 2px;
    font-style: italic;
}

/* ─── WELCOME SCREEN ─────────────────────────────────────── */
#welcome {
    text-align: center;
    gap: 0;
}

/* Animated rings */
.rings {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 32px;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.15);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 3s ease-in-out infinite;
}

    .ring:nth-child(1) {
        width: 150px;
        height: 150px;
        animation-delay: 0s;
    }

    .ring:nth-child(2) {
        width: 110px;
        height: 110px;
        animation-delay: .4s;
    }

    .ring:nth-child(3) {
        width: 74px;
        height: 74px;
        animation-delay: .8s;
    }

@keyframes pulse {
    0%, 100% {
        opacity: .15;
        transform: translate(-50%,-50%) scale(1);
    }

    50% {
        opacity: .35;
        transform: translate(-50%,-50%) scale(1.04);
    }
}

.logo-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    background: var(--grad);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(77,166,255,.4);
}

.bienvenido {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 300;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: rgba(255,255,255,.8);
    margin-bottom: 8px;
}

.bienvenido-sub {
    font-size: .88rem;
    color: rgba(255,255,255,.45);
    line-height: 1.6;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,.1);
    border-radius: 99px;
    margin-top: 36px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--grad);
    border-radius: 99px;
    animation: load 2.2s ease-in-out forwards;
}

@keyframes load {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* ─── LOGIN SCREEN ───────────────────────────────────────── */
#login {
    gap: 0;
}

.login-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 6px;
    text-align: center;
}

.login-sub {
    font-size: .8rem;
    color: rgba(255,255,255,.45);
    margin-bottom: 28px;
    text-align: center;
}

.field {
    width: 100%;
    margin-bottom: 16px;
}

    .field label {
        display: block;
        font-size: .75rem;
        font-weight: 600;
        color: rgba(255,255,255,.6);
        letter-spacing: .08em;
        text-transform: uppercase;
        margin-bottom: 6px;
    }

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.4);
    pointer-events: none;
}

.field input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    color: var(--white);
    font-family: 'Nunito', sans-serif;
    font-size: .92rem;
    outline: none;
    transition: border-color .25s, background .25s, box-shadow .25s;
}

    .field input::placeholder {
        color: rgba(255,255,255,.28);
    }

    .field input:focus {
        border-color: var(--cyan);
        background: rgba(62,207,207,.07);
        box-shadow: 0 0 0 3px rgba(62,207,207,.15);
    }

.eye-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.35);
    transition: color .2s;
}

    .eye-btn:hover {
        color: var(--cyan);
    }

.forgot {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 22px;
}

    .forgot a {
        font-size: .78rem;
        color: var(--cyan);
        text-decoration: none;
        opacity: .8;
        transition: opacity .2s;
    }

        .forgot a:hover {
            opacity: 1;
        }

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--grad);
    border: none;
    border-radius: 12px;
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .04em;
    box-shadow: 0 8px 24px rgba(77,166,255,.35);
    transition: transform .2s, box-shadow .2s;
}

    .btn-login:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(77,166,255,.5);
    }

    .btn-login:active {
        transform: translateY(0);
    }

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    color: rgba(255,255,255,.25);
    font-size: .75rem;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: rgba(255,255,255,.1);
    }

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.opt-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s;
    text-align: left;
    width: 100%;
}

    .opt-btn:hover {
        background: rgba(255,255,255,.09);
        border-color: rgba(255,255,255,.2);
        transform: translateX(3px);
    }

.opt-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.opt-text {
    flex: 1;
}

.opt-title {
    font-size: .88rem;
    font-weight: 700;
    color: var(--white);
    display: block;
}

.opt-desc {
    font-size: .74rem;
    color: rgba(255,255,255,.4);
    display: block;
}

.opt-arrow {
    color: rgba(255,255,255,.3);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--grad);
    border-radius: 0 0 28px 28px;
}

.separator-simple {
    font-size: 0.85rem;
    color: #bbb;
    margin-bottom: 10px;
}

.btn-ExternalOAuth-transparent {
    background: rgba(255,255,255,.05);
    border: 0px;
    color: white;
    font-weight: lighter;
    font-size: 0.85rem;
    color:whitesmoke;
    text-decoration: none;
    opacity: .8;
    transition: opacity .2s;
}

    .btn-ExternalOAuth-transparent:hover {
        background: rgba(255,255,255,.1);
    }

.ExternalOAuth-icon {
    width: 13px;
    height: 13px;
    margin-right: 5px;
}





    /* ── FORM COMMONS ── */
    .screen-title{font-family:'Poppins',sans-serif;font-size:1rem;font-weight:600;color:var(--white);margin-bottom:4px;text-align:center;}
    .screen-sub{font-size:.77rem;color:rgba(255,255,255,.42);margin-bottom:20px;text-align:center;line-height:1.55;}
    .field{width:100%;margin-bottom:13px;}
    .field label{display:block;font-size:.7rem;font-weight:600;color:rgba(255,255,255,.58);
                 letter-spacing:.08em;text-transform:uppercase;margin-bottom:5px;}
    .input-wrap{position:relative;}
    .input-icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:rgba(255,255,255,.36);pointer-events:none;}
    .field input{width:100%;padding:12px 13px 12px 40px;background:rgba(255,255,255,.07);
                 border:1px solid rgba(255,255,255,.12);border-radius:12px;color:var(--white);
                 font-family:'Nunito',sans-serif;font-size:.88rem;outline:none;
                 transition:border-color .25s,background .25s,box-shadow .25s;}
    .field input::placeholder{color:rgba(255,255,255,.25);}
    .field input:focus{border-color:var(--cyan);background:rgba(62,207,207,.07);box-shadow:0 0 0 3px rgba(62,207,207,.14);}
    .field input.error{border-color:#f87171;box-shadow:0 0 0 3px rgba(248,113,113,.14);}
    .field-err{font-size:.7rem;color:#fca5a5;margin-top:4px;display:none;padding-left:2px;}
    .field-err.show{display:block;}
    .eye-btn{position:absolute;right:13px;top:50%;transform:translateY(-50%);background:none;border:none;
             cursor:pointer;color:rgba(255,255,255,.33);transition:color .2s;}
    .eye-btn:hover{color:var(--cyan);}

    .btn-primary{width:100%;padding:13px;background:var(--grad);border:none;border-radius:12px;color:var(--white);
                 font-family:'Poppins',sans-serif;font-size:.9rem;font-weight:600;cursor:pointer;
                 letter-spacing:.04em;box-shadow:0 8px 24px rgba(77,166,255,.28);
                 transition:transform .2s,box-shadow .2s;}
    .btn-primary:hover{transform:translateY(-2px);box-shadow:0 12px 32px rgba(77,166,255,.46);}
    .btn-primary:active{transform:translateY(0);}

    .back-link{font-size:.76rem;color:rgba(255,255,255,.38);text-align:center;margin-top:14px;cursor:pointer;
               transition:color .2s;display:flex;align-items:center;justify-content:center;gap:5px;}
    .back-link:hover{color:var(--cyan);}


    /* ── LOGIN extras ── */
    .forgot-row{text-align:right;margin:-4px 0 16px;}
    .forgot-row a{font-size:.74rem;color:var(--cyan);text-decoration:none;opacity:.8;transition:opacity .2s;cursor:pointer;}
    .forgot-row a:hover{opacity:1;}
    .divider{display:flex;align-items:center;gap:10px;margin:14px 0;color:rgba(255,255,255,.23);font-size:.72rem;}
    .divider::before,.divider::after{content:'';flex:1;height:1px;background:rgba(255,255,255,.1);}
    .options{display:flex;flex-direction:column;gap:8px;width:100%;}
    .opt-btn{display:flex;align-items:center;gap:12px;padding:11px 14px;background:rgba(255,255,255,.05);
             border:1px solid rgba(255,255,255,.1);border-radius:12px;cursor:pointer;width:100%;text-align:left;
             transition:background .2s,border-color .2s,transform .2s;}
    .opt-btn:hover{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.2);transform:translateX(3px);}
    .opt-icon{width:35px;height:35px;border-radius:9px;background:var(--dark);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
    .opt-text{flex:1;}
    .opt-title{font-size:.83rem;font-weight:700;color:var(--white);display:block;}
    .opt-desc{font-size:.7rem;color:rgba(255,255,255,.36);display:block;}
    .opt-arrow{color:rgba(255,255,255,.26);font-size:1.1rem;}

    /* ── SUCCESS BOX ── */
    .success-box{text-align:center;padding:6px 0;}
    .success-circle{width:56px;height:56px;border-radius:50%;background:var(--grad);display:flex;
                    align-items:center;justify-content:center;margin:0 auto 14px;
                    box-shadow:0 8px 24px rgba(77,166,255,.35);}

    /* ── TOAST ── */
    .toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%) translateY(16px);
           background:rgba(18,30,55,.95);backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.12);
           border-radius:14px;padding:12px 20px;color:var(--white);font-size:.83rem;
           box-shadow:0 10px 36px rgba(0,0,0,.4);opacity:0;pointer-events:none;
           transition:opacity .3s,transform .3s;z-index:999;display:flex;align-items:center;gap:10px;min-width:220px;}
    .toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
    .toast.success .t-icon{color:#4ade80;}
    .toast.error   .t-icon{color:#f87171;}
    .toast.info    .t-icon{color:var(--cyan);}