/* ============================
   AUTH - Login & Password Reset
   Theme: Light
   ============================ */

/* ============================
   VARIABLES
============================ */
:root {
    --auth-bg: #3d8b8b;
    --auth-bg-gradient: linear-gradient(145deg, #0A5159 0%, #0D6973 50%, #0D6973 100%);
    --auth-circle-border: rgba(255, 255, 255, 0.08);
    --auth-circle-border-subtle: rgba(255, 255, 255, 0.06);
    --auth-circle-border-faint: rgba(255, 255, 255, 0.04);
    --auth-arc-border: rgba(255, 255, 255, 0.07);

    --auth-card-bg: #ffffff;
    --auth-card-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    --auth-card-radius: 20px;

    --auth-text-primary: #1a1a2e;
    --auth-text-secondary: #8e8ea0;
    --auth-text-placeholder: #9ca3af;

    --auth-input-bg: #f0f4f8;
    --auth-input-bg-hover: #e8eef4;
    --auth-input-bg-focus: #ffffff;
    --auth-input-border-focus: #4a9696;
    --auth-input-shadow-focus: 0 0 0 3px rgba(74, 150, 150, 0.12);
    --auth-input-radius: 14px;

    --auth-btn-gradient: linear-gradient(135deg, #5ba8a8 0%, #4a9696 50%, #3d8b8b 100%);
    --auth-btn-gradient-hover: linear-gradient(135deg, #4a9696 0%, #3d8b8b 50%, #2d7a7a 100%);
    --auth-btn-shadow-hover: 0 8px 24px rgba(61, 139, 139, 0.35);
    --auth-btn-color: #ffffff;

    --auth-link-color: #4a9696;
    --auth-link-hover: #2d7a7a;

    --auth-error-bg: #fef2f2;
    --auth-error-border: #fecaca;
    --auth-error-color: #dc2626;

    --auth-footer-color: rgba(255, 255, 255, 0.6);
    --auth-icon-color: #9ca3af;
    --auth-icon-focus: #4a9696;
}

/* ============================
   BASE
============================ */
.auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg);
    background: var(--auth-bg-gradient);
    position: relative;
    overflow-x: hidden;
    padding: 1rem;
}

/* ============================
   FONDO - Círculos concéntricos
============================ */
.auth-bg-circles {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-bg-circles::before,
.auth-bg-circles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--auth-circle-border);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.auth-bg-circles::before { width: 900px; height: 900px; }
.auth-bg-circles::after { width: 1300px; height: 1300px; }

.auth-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--auth-circle-border-subtle);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.auth-circle--1 { width: 500px; height: 500px; }
.auth-circle--2 { width: 700px; height: 700px; }
.auth-circle--3 { width: 1100px; height: 1100px; }
.auth-circle--4 { width: 1500px; height: 1500px; }
.auth-circle--5 { width: 1800px; height: 1800px; border-color: var(--auth-circle-border-faint); }

.auth-arc-tl {
    position: absolute;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    border: 1px solid var(--auth-arc-border);
}

.auth-arc-br {
    position: absolute;
    bottom: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    border: 1px solid var(--auth-arc-border);
}

/* ============================
   CARD
============================ */
.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 3rem 2.5rem;
    background: var(--auth-card-bg);
    border-radius: var(--auth-card-radius);
    box-shadow: var(--auth-card-shadow);
    animation: authCardEntry 0.5s ease-out;
}

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

/* ============================
   LOGO
============================ */
.auth-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo img {
    height: 64px;
    width: auto;
}

/* ============================
   HEADER
============================ */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.9rem;
    color: var(--auth-text-secondary);
    font-weight: 400;
    line-height: 1.5;
}

/* ============================
   ALERTA ERROR
============================ */
.auth-alert-error {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    border-radius: 12px;
    font-size: 0.82rem;
    color: var(--auth-error-color);
    font-weight: 500;
}

.auth-alert-error.show {
    display: flex;
}

.auth-alert-error svg {
    flex-shrink: 0;
}

/* ============================
   CAMPOS
============================ */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin-bottom: 0.5rem;
}

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

.auth-field-input input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.75rem;
    font-size: 0.9rem;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    color: var(--auth-text-primary);
    background: var(--auth-input-bg);
    border: 1.5px solid transparent;
    border-radius: var(--auth-input-radius);
    outline: none;
    transition: all 0.2s ease;
    -moz-appearance: textfield;
}

.auth-field-input input::-webkit-outer-spin-button,
.auth-field-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.auth-field-input input::placeholder {
    color: var(--auth-text-placeholder);
}

.auth-field-input input:hover {
    background: var(--auth-input-bg-hover);
}

.auth-field-input input:focus {
    background: var(--auth-input-bg-focus);
    border-color: var(--auth-input-border-focus);
    box-shadow: var(--auth-input-shadow-focus);
}

.auth-field-input input.is-invalid {
    border-color: var(--auth-error-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.auth-field-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--auth-icon-color);
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-field-input input:focus ~ .auth-field-icon {
    color: var(--auth-icon-focus);
}

/* Toggle password */
.auth-btn-toggle-pass {
    position: absolute;
    right: 0.85rem;
    background: none;
    border: none;
    color: var(--auth-icon-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.auth-btn-toggle-pass:hover {
    color: var(--auth-icon-focus);
}

/* ============================
   ACCIONES
============================ */
.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    margin-top: -0.25rem;
}

.auth-forgot-link {
    font-size: 0.8rem;
    color: var(--auth-link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: var(--auth-link-hover);
    text-decoration: underline;
}

/* ============================
   BOTÓN
============================ */
.auth-btn-login {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--auth-btn-color);
    background: var(--auth-btn-gradient);
    border: none;
    border-radius: var(--auth-input-radius);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
}

.auth-btn-login:hover {
    background: var(--auth-btn-gradient-hover);
    transform: translateY(-1px);
    box-shadow: var(--auth-btn-shadow-hover);
}

.auth-btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(61, 139, 139, 0.25);
}

.auth-btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.auth-btn-login .auth-arrow {
    transition: transform 0.2s ease;
}

.auth-btn-login:hover .auth-arrow {
    transform: translateX(3px);
}

.auth-btn-login .auth-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

.auth-btn-login.loading .auth-spinner { display: block; }
.auth-btn-login.loading .auth-btn-label { opacity: 0.7; }
.auth-btn-login.loading .auth-arrow { display: none; }

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

/* ============================
   FOOTER
============================ */
.auth-footer {
    position: relative;
    z-index: 10;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--auth-footer-color);
    font-weight: 400;
}

/* ============================
   ENV BANNER
============================ */
.auth-env-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.5rem;
    background: #dc2626;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
}

/* ============================
   RESPONSIVE
============================ */

/* Tablets y pantallas medianas */
@media (max-width: 768px) {
    .auth-card {
        max-width: 400px;
        padding: 2.5rem 2rem;
    }

    .auth-circle--4,
    .auth-circle--5 {
        display: none;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .auth-body {
        padding: 1rem 0.75rem;
        overflow-y: auto;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        max-width: 100%;
    }

    .auth-logo img {
        height: 52px;
    }

    .auth-header {
        margin-bottom: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.4rem;
    }

    .auth-header p {
        font-size: 0.85rem;
    }

    .auth-field-input input {
        padding: 0.8rem 1rem 0.8rem 2.5rem;
        font-size: 0.875rem;
    }

    .auth-btn-login {
        padding: 0.85rem 1.25rem;
        font-size: 0.9rem;
    }

    .auth-footer {
        margin-top: 1.5rem;
        font-size: 0.7rem;
    }

    .auth-circle,
    .auth-bg-circles::before,
    .auth-bg-circles::after,
    .auth-arc-tl,
    .auth-arc-br {
        display: none;
    }
}

/* Pantallas muy pequeñas en altura (landscape mobile) */
@media (max-height: 650px) {
    .auth-body {
        overflow-y: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .auth-card {
        padding: 1.75rem 1.5rem;
    }

    .auth-logo {
        margin-bottom: 1rem;
    }

    .auth-logo img {
        height: 48px;
    }

    .auth-header {
        margin-bottom: 1.25rem;
    }

    .auth-header h1 {
        font-size: 1.35rem;
    }

    .auth-field {
        margin-bottom: 1rem;
    }
}

/* ============================
   WHATSAPP FAB
============================ */
.auth-whatsapp-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    height: 56px;
    padding: 0 16px;
    background: #25D366;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    overflow: hidden;
    width: 56px;
}

.auth-whatsapp-btn svg {
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.auth-whatsapp-btn .auth-whatsapp-text {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0;
}

.auth-whatsapp-btn:hover {
    width: auto;
    padding: 0 20px;
    gap: 8px;
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.auth-whatsapp-btn:hover .auth-whatsapp-text {
    max-width: 120px;
    opacity: 1;
    margin-left: 4px;
}

.auth-whatsapp-btn:active {
    transform: scale(0.97);
}

@media (max-width: 480px) {
    .auth-whatsapp-btn {
        bottom: 1.25rem;
        right: 1.25rem;
        height: 50px;
        width: 50px;
        padding: 0 14px;
        border-radius: 25px;
    }

    .auth-whatsapp-btn svg {
        width: 24px;
        height: 24px;
    }

    .auth-whatsapp-btn:hover {
        padding: 0 18px;
    }
}
