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

body {
    font-family: var(--font-text);
    background: linear-gradient(135deg, var(--bg), #c8d8f5);
    min-height: 100vh;
    display: flex;
    flex-direction:column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.powered_section {
    display: flex;
    width: 100%;
    max-width: 880px;
    justify-content: flex-end;
    gap:4px;
    margin-top:12px;
}

.powered_logo {
    width:90px;
    height:100%;
}

.powered_by {
    font-size: 14px;
    color: #000;
    font-weight: 400;
    font-family: var(--font-text-2);
}

/* ===== Wrapper: mensaje + contenedor ===== */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 880px;
}

/* Mensajes globales */
#authMsg {
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    text-align: center;
    display: none;
}

#authMsg.error {
    background: #fee4e2;
    color: #b42318;
    border: 1px solid #fecdca;
}

#authMsg.success {
    background: #d1fadf;
    color: #067647;
    border: 1px solid #a6f4c5;
}

/* ===== Contenedor principal (el "card") ===== */
.auth-container {
    position: relative;
    width: 100%;
    min-height: 560px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

/* ===== Form boxes ===== */
.form-box {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    z-index: 1;
    overflow-y: auto;
    transition: right 0.6s ease-in-out 1.2s;
}

/* El registro empieza invisible en la misma posición que login (right:0 → mismo recorrido → animación sincronizada) */
.form-box--register {
    opacity: 0;
    pointer-events: none;
    transition: right 0.6s ease-in-out 1.2s, opacity 0s 1.2s;
}

/* Modo registro: ambos forms se desplazan al lado izquierdo */
#authRoot.auth--register .form-box {
    right: 50%;
}

#authRoot.auth--register .form-box--register {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Contenido del form ===== */
form {
    width: 100%;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    font-family: 'Inter', sans-seriff;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: -0.3px;
}

/* ===== Input boxes ===== */
.input-box {
    position: relative;
    margin-bottom: 18px;
}

.input-box input {
    width: 100%;
    padding: 13px 48px 13px 20px;
    background: #eef0f5;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 15px;
    color: #1a1a2e;
    font-weight: 500;
    font-family: var(--font-text-2);
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.input-box input:focus {
    background: #fff;
    border-color: var(--main);
}

.input-box input::placeholder {
    color: #9098b1;
    font-weight: 400;
}

.input-box i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 17px;
    color: #b0b8cc;
    pointer-events: none;
}

.input-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b0b8cc;
    font-size: 17px;
    transition: color 0.18s;
}

.input-eye i {
    right:8px;
    color: #b0b8cc;
}

.input-eye:hover, .input-eye i:hover {
    color: var(--main);
}

/* Hint de código y link reenvío */
.input-hint {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin: 6px 0 8px 4px;
}

.resend-link {
    display: inline-block;
    margin-left: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.resend-link:hover {
    opacity: 0.75;
}

/* ===== Botones ===== */
.btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-text-2);
    letter-spacing: 0.2px;
    transition: all 0.22s ease;
}

.btn--primary {
    background: var(--main);
    color: #fff;
    box-shadow: 0 4px 14px rgba(35, 63, 118, 0.25);
}

.btn--primary:hover {
    background: #1b3060;
    box-shadow: 0 6px 18px rgba(35, 63, 118, 0.35);
}

/* Botones del panel deslizante */
.btn--outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: none;
    width: 170px;
    height: 44px;
    font-size: 14px;
}

.btn--outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Elimina todas las transiciones para carga directa vía hash */
.auth--instant,
.auth--instant * {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

.btn-loading {
    opacity: 0.85;
    pointer-events: none;
}

/* ===== Paso de contraseña (animación de entrada) ===== */
.password-step {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.password-step.password-step--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Toggle box (panel deslizante animado) ===== */
.toggle-box {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* El blob: bloque de color que se desliza de izquierda a derecha */
.toggle-box::before {
    content: '';
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;
    background: var(--main);
    border-radius: 120px;
    z-index: 2;
    transition: left 1.8s ease-in-out;
    pointer-events: none;
}

#authRoot.auth--register .toggle-box::before {
    left: 50%;
}

/* ===== Toggle panels ===== */
.toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 44px 36px;
    z-index: 3;
    transition: 0.6s ease-in-out;
    pointer-events: auto;
}

/* Panel izquierdo: visible por defecto (login mode) */
.toggle-left {
    left: 0;
    transition-delay: 1.2s;
}

#authRoot.auth--register .toggle-left {
    left: -50%;
    transition-delay: 0.6s;
}

/* Panel derecho: visible en modo registro */
.toggle-right {
    right: -50%;
    transition-delay: 0.6s;
}

#authRoot.auth--register .toggle-right {
    right: 0;
    transition-delay: 1.2s;
}

/* Contenido del toggle panel */
.toggle-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.toggle-logo {
    width: 140px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.text-logo {
    font-size: 34px;
    font-family: var(--font-logo);
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.5px;
}

.login-slogan {
    font-size: 17.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.80);
    line-height: 1.3em;
    max-width: 240px;
    margin-bottom: 6px;
    height: 46px;
}

.toggle-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.toggle-prompt {
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.85);
}

/* Typewriter cursor en el slogan (ambos paneles) */
#loginSlogan,
#loginSloganRight {
    position: relative;
    display: inline-block;
}

#loginSlogan[data-typing="1"]::after,
#loginSloganRight[data-typing="1"]::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: rgba(255, 255, 255, 0.7);
    margin-left: 4px;
    transform: translateY(2px);
    animation: sloganCursorBlink 0.9s steps(1) infinite;
}

@keyframes sloganCursorBlink {
    50% { opacity: 0; }
}

/* ===== Responsive ===== */
@media (max-width: 680px) {
    .auth-container {
        min-height: calc(100dvh - 80px);
        border-radius: 18px;
    }

    /* Los form boxes se apilan verticalmente */
    .form-box {
        bottom: 0;
        top: auto;
        right: 0;
        width: 100%;
        height: 70%;
        padding: 28px 24px;
        transition: bottom 0.6s ease-in-out 1.2s;
    }

    .form-box--register {
        transition: bottom 0.6s ease-in-out 1.2s, visibility 0s 1s;
    }

    #authRoot.auth--register .form-box {
        right: 0;
        bottom: 30%;
    }

    /* El blob se desliza verticalmente */
    .toggle-box::before {
        left: 0;
        top: -270%;
        width: 100%;
        height: 300%;
        border-radius: 20vw;
        transition: top 1.8s ease-in-out;
    }

    #authRoot.auth--register .toggle-box::before {
        left: 0;
        top: 70%;
    }

    .toggle-panel {
        width: 100%;
        height: 30%;
        padding: 16px 24px;
        gap: 6px;
    }

    .toggle-left {
        left: 0;
        top: 0;
        transition-delay: 1.2s;
    }

    #authRoot.auth--register .toggle-left {
        left: 0;
        top: -30%;
        transition-delay: 0.6s;
    }

    .toggle-right {
        right: 0;
        bottom: -30%;
        transition-delay: 0.6s;
    }

    #authRoot.auth--register .toggle-right {
        bottom: 0;
        transition-delay: 1.2s;
    }

    .toggle-brand { gap: 8px; }
    .toggle-logo { width: 120px; }
    .login-slogan { font-size: 16px; }
    .toggle-prompt { font-size: 13px; }

    .btn--outline {
        width: 140px;
        height: 40px;
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .form-box { padding: 20px 18px; }
}

/* ===== Link olvidé contraseña ===== */
.forgot-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: var(--main);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}
.forgot-link:hover { opacity: 0.75; }

/* ===== Modal: Recuperar contraseña ===== */
.fp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.22s;
}
.fp-overlay--visible {
    display: block;
    opacity: 1;
}

.fp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 201;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.25s, transform 0.25s;
}
.fp-modal--visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.fp-modal__inner {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 420px;
    padding: 28px 28px 24px;
    margin: 16px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

.fp-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.fp-modal__title {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a2e;
    font-family: var(--font-text-2);
    margin: 0;
}

.fp-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
}
.fp-modal__close:hover {
    background: #e2e8f0;
    color: #1a1a2e;
}

/* Indicador de pasos */
.fp-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    gap: 0;
}

.fp-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.fp-step__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.25s;
}

.fp-step--active .fp-step__dot {
    border-color: var(--main);
    background: var(--main);
}

.fp-step--done .fp-step__dot {
    border-color: #22c55e;
    background: #22c55e;
    position: relative;
}
.fp-step--done .fp-step__dot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='white' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E") center/14px no-repeat;
}

.fp-step__label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    transition: color 0.25s;
    white-space: nowrap;
}
.fp-step--active .fp-step__label {
    color: var(--main);
    font-weight: 600;
}
.fp-step--done .fp-step__label { color: #22c55e; }

.fp-step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    min-width: 16px;
    max-width: 40px;
    margin-bottom: 16px;
    transition: background 0.25s;
}
.fp-step-line--done { background: #22c55e; }

/* Panes */
.fp-pane { animation: fpFadeIn 0.22s ease; }

@keyframes fpFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fp-desc {
    font-size: 14px;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Botones dentro del modal con margen top */
.fp-pane .btn { margin-top: 4px; }

/* Mensaje */
.fp-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}
.fp-msg.error {
    background: #fee4e2;
    color: #b42318;
    border: 1px solid #fecdca;
}
.fp-msg.success {
    background: #d1fadf;
    color: #067647;
    border: 1px solid #a6f4c5;
}

/* Éxito */
.fp-success {
    text-align: center;
    padding: 8px 0 4px;
}
.fp-success__icon {
    font-size: 54px;
    color: #22c55e;
    display: block;
    margin-bottom: 14px;
}
.fp-success__text {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.fp-success__sub {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 22px;
    line-height: 1.5;
}
