/* --- CONTENEDOR DE LAS TARJETAS --- */
.login-wrapper {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    margin: auto;
}

/* Base centrada para el login */
body.login-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

/* --- PESTAÑA PAYPAL --- */
.paypal-tab {
    position: absolute;
    top: -35px;
    right: 25px;
    background: white;
    padding: 0.4rem 0.8rem;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--borde-azul);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.02);
}
.paypal-tab img {
    height: 24px;
    width: auto;
}

/* --- SISTEMA DE GIRO 3D --- */
.auth-flip-container {
    width: 100%;
    perspective: 1200px;
    position: relative;
    z-index: 10;
}

.auth-flipper {
    width: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.auth-flip-container.is-flipped .auth-flipper {
    transform: rotateY(180deg);
}

.auth-front, .auth-back {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
}

.auth-front {
    position: relative; 
    z-index: 2;
    transform: rotateY(0deg);
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.auth-back {
    transform: rotateY(180deg);
    pointer-events: none;
    z-index: 1;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.auth-flip-container.is-flipped .auth-front {
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.auth-flip-container.is-flipped .auth-back {
    pointer-events: auto;
    z-index: 3;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s ease, visibility 0s linear 0s;
}

/* --- TARJETA PRINCIPAL (LOGIN) --- */
.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radio-large);
    padding: 2.5rem 2rem;
    box-shadow: var(--sombra);
}

.brand-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.brand-logos img {
    height: 128px;
    width: auto;
    object-fit: contain;
}

.login-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #000000;
}

/* --- FORMULARIO E INPUTS --- */
.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-group svg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: color 0.2s;
}

.form-group.has-error svg {
    top: 35%;
}

.form-group svg:not(.toggle-password) {
    left: 12px;
    pointer-events: none;
}

.form-group svg.toggle-password {
    right: 12px;
    cursor: pointer;
    pointer-events: auto;
    color: #475569;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 1px solid var(--borde-input);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
}

.form-group input:focus {
    border-color: var(--azul-primario);
}

/* --- VALIDACIONES Y ERRORES --- */
.error-message {
    display: block;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.25rem;
    padding-left: 0.5rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    margin-top: 0.4rem;
}

.form-group.has-error input {
    border-color: #f87171 !important;
    background-color: #fef2f2;
}

.form-group.has-error svg {
    color: #f87171;
}

/* Botones Principales */
.btn-submit {
    width: 100%;
    background-color: var(--azul-primario);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: var(--radio-pill);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s;
}
.btn-submit:hover {
    background-color: var(--azul-hover);
}

.remember-me-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: #516074;
    font-size: 0.9rem;
    cursor: pointer;
}

.remember-me-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--azul-primario);
    cursor: pointer;
}

.forgot-password {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    color: #475569;
    font-size: 0.85rem;
    text-decoration: none;
}
.forgot-password:hover {
    text-decoration: underline;
}

/* Botones Secundarios */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--texto-secundario);
    width: 100%;
    padding: 1rem 0 0 0;
    margin-top: 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-top: 1px solid var(--borde-input);
    transition: color 0.3s;
}
.btn-ghost strong { color: var(--azul-primario); }
.btn-ghost:hover strong { color: var(--azul-hover); }

.btn-back-link {
    background: transparent;
    border: none;
    color: var(--texto-secundario);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}
.btn-back-link:hover { color: var(--azul-primario); }

.subtitle-text {
    font-size: 0.85rem;
    color: var(--texto-secundario);
    margin-bottom: 1.5rem;
}

/* Paneles Dinámicos */
.back-panel {
    width: 100%;
    animation: fadeIn 0.3s ease forwards;
}

/* --- WIZARD PROGRESS --- */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.wizard-progress .step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-principal);
    border: 2px solid var(--borde-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--texto-secundario);
    transition: all 0.3s ease;
}

.wizard-progress .step.active {
    background: var(--azul-primario);
    border-color: var(--azul-primario);
    color: white;
}

.wizard-progress .step-line {
    flex: 1;
    height: 2px;
    background: var(--borde-input);
    margin: 0 10px;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- TARJETA INFERIOR STRUCTURAL --- */
.info-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--borde-azul);
    border-radius: var(--radio-large);
    min-height: 110px;
    box-shadow: var(--sombra);
    padding: 1rem;
}

/* --- OPTIMIZADO FOOTER --- */
.browsers-footer {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.browser-icons {
    display: flex;
    gap: 0.75rem;
}
.browser-icons .icon-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}
.dot-chrome { background: #ea4335; }
.dot-firefox { background: #f96816; }
.dot-safari { background: #0070c9; }

.browsers-footer p {
    font-size: 0.75rem;
    color: #475569;
}

/* --- MODAL MATERIAL DESIGN --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalFadeIn 0.2s ease;
}

.modal-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
    margin-bottom: 1rem;
}

.modal-icon svg {
    display: block;
    margin: 0 auto;
}

.modal-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.75rem 0;
    letter-spacing: 0.03em;
}

.modal-card p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 0.65rem 1.5rem;
    border-radius: var(--radio-pill);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.modal-btn-primary {
    background: var(--azul-primario);
    color: white;
}
.modal-btn-primary:hover {
    background: var(--azul-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.modal-btn-ghost {
    background: transparent;
    color: var(--texto-secundario);
    border: 1px solid var(--borde-input);
}
.modal-btn-ghost:hover {
    background: var(--bg-principal);
    color: #0f172a;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- SELECTOR DE IDIOMA --- */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: 1.5px solid var(--borde-input);
    color: var(--texto-secundario);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radio-pill);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.05em;
    font-family: inherit;
}

.lang-btn:hover {
    border-color: var(--azul-primario);
    color: var(--azul-primario);
}

.lang-btn.active {
    background: var(--azul-primario);
    border-color: var(--azul-primario);
    color: white;
}

.lang-divider {
    color: #cbd5e1;
    font-size: 0.8rem;
}
