/* ================================================================
   WaMenu — Auth CSS (Login / Registro / Recuperar / Reset)
   Diseño corporativo dos columnas: Splash izquierda + Form derecha
   Colores marca: #569d52 (verde), #e97e2b (naranja), #faffda (crema)
   ================================================================ */

/* ---- Reset & base ---- */
* { box-sizing: border-box; }

/* ---- Layout principal: dos columnas ---- */
.auth-wrap {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f8faf9;
}

/* ---- Columna izquierda (splash / branding) ---- */
.auth-splash {
    flex: 0 0 46%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
    background: linear-gradient(135deg, #569d52 0%, #3d7a3a 50%, #2f5e2d 100%);
    color: #fff;
}

/* Burbujas decorativas animadas */
.auth-splash::before,
.auth-splash::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    pointer-events: none;
}
.auth-splash::before {
    width: 340px; height: 340px;
    top: -80px; right: -60px;
    animation: floatBlob 8s ease-in-out infinite;
}
.auth-splash::after {
    width: 220px; height: 220px;
    bottom: 40px; left: -40px;
    animation: floatBlob 10s ease-in-out infinite reverse;
}

/* Splash extra decor */
.auth-splash-decor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.auth-splash-decor.d1 {
    width: 120px; height: 120px;
    top: 45%; right: 15%;
    background: rgba(233,126,43,.18);
    animation: floatBlob 7s ease-in-out infinite;
}
.auth-splash-decor.d2 {
    width: 80px; height: 80px;
    top: 20%; left: 10%;
    background: rgba(250,255,218,.12);
    animation: floatBlob 9s ease-in-out infinite reverse;
}

@keyframes floatBlob {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(20px,-30px) scale(1.08); }
}

/* Splash contenido */
.auth-splash-content {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

.auth-splash-logo {
    margin-bottom: 2.5rem;
}
.auth-splash-logo img {
    max-height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.2));
}

.auth-splash-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: .75rem;
    color: #faffda;
}
.auth-splash-title strong {
    color: #fff;
    font-weight: 800;
}
.auth-splash-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255,255,255,.85);
    margin-bottom: 2.5rem;
}

/* Features list en splash */
.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}
.auth-feature-icon {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.auth-feature-text {
    font-size: .9rem;
    line-height: 1.5;
    color: rgba(255,255,255,.92);
}
.auth-feature-text strong {
    display: block;
    font-weight: 600;
    color: #fff;
    font-size: .95rem;
    margin-bottom: 2px;
}

/* Splash footer */
.auth-splash-footer {
    position: absolute;
    bottom: 2rem;
    left: 3rem;
    right: 3rem;
    z-index: 2;
    font-size: .8rem;
    color: rgba(255,255,255,.6);
}

/* ---- Columna derecha (formulario) ---- */
.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

.auth-form-wrap {
    width: 100%;
    max-width: 440px;
}

/* Logo en mobile (cuando splash está oculto) */
.auth-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 1.75rem;
}
.auth-mobile-logo img {
    max-height: 50px;
    width: auto;
}

/* Cabecera del formulario */
.auth-form-head {
    margin-bottom: 2rem;
}
.auth-form-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a2e1a;
    margin-bottom: .5rem;
}
.auth-form-subtitle {
    font-size: .9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ---- Alertas ---- */
.auth-alert {
    border-radius: 12px;
    padding: .85rem 1rem;
    font-size: .875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    line-height: 1.45;
}
.auth-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.auth-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.auth-alert ul {
    margin: 0;
    padding-left: 1.1rem;
}
.auth-alert-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

/* ---- Campos de formulario ---- */
.auth-field {
    margin-bottom: 1.1rem;
}
.auth-field-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
}

.auth-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .4rem;
    letter-spacing: .01em;
}

.auth-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: .85rem;
    color: #9ca3af;
    font-size: 1.05rem;
    pointer-events: none;
    transition: color .2s;
}

.auth-input {
    width: 100%;
    padding: .72rem 1rem .72rem 2.5rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: .9rem;
    font-family: 'Inter', sans-serif;
    color: #1f2937;
    background: #fff;
    transition: all .18s ease;
    outline: none;
}
.auth-input::placeholder {
    color: #b0b0b0;
}
.auth-input:focus {
    border-color: #569d52;
    box-shadow: 0 0 0 4px rgba(86,157,82,.12);
}
.auth-input:focus + .auth-input-icon,
.auth-input-group:focus-within .auth-input-icon {
    color: #569d52;
}

/* Variante sin icono */
.auth-input.no-icon {
    padding-left: 1rem;
}

/* Toggle password */
.auth-pw-toggle {
    position: absolute;
    right: .75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1.1rem;
    padding: .25rem;
    line-height: 1;
    transition: color .2s;
}
.auth-pw-toggle:hover {
    color: #569d52;
}

/* Select */
.auth-select {
    width: 100%;
    padding: .72rem 1rem .72rem 2.5rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: .9rem;
    font-family: 'Inter', sans-serif;
    color: #1f2937;
    background: #fff;
    transition: all .18s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    padding-right: 2.2rem;
}
.auth-select:focus {
    border-color: #569d52;
    box-shadow: 0 0 0 4px rgba(86,157,82,.12);
}

/* ---- Botones ---- */
.auth-btn {
    width: 100%;
    padding: .8rem 1.5rem;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.auth-btn-primary {
    background: linear-gradient(135deg, #569d52 0%, #4a8a47 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(86,157,82,.3);
}
.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(86,157,82,.4);
}
.auth-btn-primary:active {
    transform: translateY(0);
}
.auth-btn-secondary {
    background: linear-gradient(135deg, #e97e2b 0%, #d46e1f 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(233,126,43,.3);
}
.auth-btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233,126,43,.4);
}
.auth-btn-outline {
    background: #fff;
    color: #374151;
    border: 1.5px solid #e0e0e0;
}
.auth-btn-outline:hover {
    border-color: #569d52;
    color: #569d52;
    background: #f0fdf4;
}

/* ---- Recordar / Olvidaste ---- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    font-size: .85rem;
}
.auth-remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}
.auth-remember input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #569d52;
    border-radius: 4px;
    cursor: pointer;
}
.auth-link {
    color: #e97e2b;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s;
}
.auth-link:hover {
    color: #c46e1f;
    text-decoration: underline;
}
.auth-link-green {
    color: #569d52;
}
.auth-link-green:hover {
    color: #447a42;
}

/* ---- Divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-size: .8rem;
    font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.auth-divider span {
    padding: 0 1rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ---- Footer del form (toggle entre login/registro) ---- */
.auth-form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: .875rem;
    color: #6b7280;
}
.auth-form-footer a {
    margin-left: .25rem;
}

/* ---- Wizard (registro 2 pasos) ---- */
.auth-wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
    width: 100%;
    gap: 0;
}
.auth-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
    min-width: 72px;
}
.auth-wizard-step-num {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    transition: all .3s ease;
    flex-shrink: 0;
}
.auth-wizard-step-num.active {
    background: #569d52;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(86,157,82,.15);
}
.auth-wizard-step-num.completed {
    background: #569d52;
    color: #fff;
}
.auth-wizard-step-num.inactive {
    background: #e5e7eb;
    color: #9ca3af;
}
.auth-wizard-step-label {
    font-size: .73rem;
    font-weight: 600;
    color: #6b7280;
    transition: color .3s;
    text-align: center;
    white-space: nowrap;
}
.auth-wizard-step.active .auth-wizard-step-label,
.auth-wizard-step.completed .auth-wizard-step-label {
    color: #1a2e1a;
}
.auth-wizard-step-line {
    flex: 1;
    min-width: 70%;
    height: 2px;
    background: #e5e7eb;
    border-radius: 2px;
    transition: background .3s;
    margin-bottom: 1.1rem;
    max-width: none;
}
.auth-wizard-step-line.completed {
    background: #569d52;
}

.auth-wizard-panel {
    display: none;
}
.auth-wizard-panel.active {
    display: block;
    animation: fadeSlideIn .35s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.auth-wizard-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.25rem;
}
.auth-wizard-actions .auth-btn {
    flex: 1;
}

/* ---- Password strength meter ---- */
.auth-pw-strength {
    margin-top: .5rem;
}
.auth-pw-strength-bar {
    height: 5px;
    border-radius: 4px;
    background: #e5e7eb;
    overflow: hidden;
    transition: background .3s;
}
.auth-pw-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width .3s, background .3s;
}
.auth-pw-strength-fill.weak   { width: 25%; background: #ef4444; }
.auth-pw-strength-fill.fair    { width: 50%; background: #f59e0b; }
.auth-pw-strength-fill.good    { width: 75%; background: #569d52; }
.auth-pw-strength-fill.strong  { width: 100%; background: #2f5e2d; }
.auth-pw-strength-label {
    font-size: .72rem;
    margin-top: .3rem;
    color: #6b7280;
    font-weight: 500;
}

/* ---- Tarjeta de plan seleccionado (wizard paso 2) ---- */
.auth-plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .65rem;
    margin-bottom: 1rem;
}
.auth-plan-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: .85rem .5rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.auth-plan-card:hover {
    border-color: #569d52;
    background: #f0fdf4;
}
.auth-plan-card.selected {
    border-color: #569d52;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(86,157,82,.12);
}
.auth-plan-card.selected::after {
    content: '✓';
    position: absolute;
    top: -8px; right: -8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #569d52;
    color: #fff;
    font-size: .75rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.auth-plan-name {
    font-size: .8rem;
    font-weight: 700;
    color: #1a2e1a;
    margin-bottom: .15rem;
}
.auth-plan-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #569d52;
}
.auth-plan-price span {
    font-size: .7rem;
    font-weight: 500;
    color: #6b7280;
}

/* ---- Info box ---- */
.auth-info-box {
    background: #faffda;
    border: 1px solid #e8e8c8;
    border-radius: 12px;
    padding: .85rem 1rem;
    font-size: .82rem;
    color: #4a4a2a;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
}
.auth-info-box-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

/* ---- Back to home ---- */
.auth-back-home {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}
.auth-back-home a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    padding: .4rem .8rem;
    border-radius: 8px;
    transition: all .2s;
}
.auth-back-home a:hover {
    background: #f0f0f0;
    color: #1a2e1a;
}

/* ---- Animación de carga en botón ---- */
.auth-btn.loading {
    pointer-events: none;
    opacity: .7;
}
.auth-btn .auth-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: none;
}
.auth-btn.loading .auth-spinner {
    display: block;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Responsive: ocultar splash en mobile ---- */
@media (max-width: 900px) {
    .auth-splash {
        display: none;
    }
    .auth-mobile-logo {
        display: block;
    }
}

@media (max-width: 640px) {
    .auth-form-side {
        padding: 1.5rem 1rem;
    }
    .auth-form-title {
        font-size: 1.5rem;
    }
    .auth-field-grid2 {
        grid-template-columns: 1fr;
    }
    .auth-plan-grid {
        grid-template-columns: 1fr;
    }
    .auth-back-home {
        top: 1rem;
        right: 1rem;
    }
}

/* ---- Accesibilidad: reducir movimiento ---- */
@media (prefers-reduced-motion: reduce) {
    .auth-splash::before,
    .auth-splash::after,
    .auth-splash-decor {
        animation: none;
    }
    .auth-wizard-panel.active {
        animation: none;
    }
    .auth-btn-primary:hover,
    .auth-btn-secondary:hover {
        transform: none;
    }
}
