/* ============================================================
   PataNet — Auth
   Fondo de parque/mascotas, paleta índigo + violeta
   ============================================================ */
:root {
    --indigo: #4f46e5;
    --indigo-hover: #4338ca;
    --indigo-soft: rgba(79, 70, 229, 0.1);
    --indigo-glow: rgba(79, 70, 229, 0.22);
    --indigo-shadow: rgba(79, 70, 229, 0.13);
    --indigo-border: rgba(79, 70, 229, 0.2);
    --violet: #7c3aed;
    --violet-hover: #6d28d9;
    --violet-soft: rgba(124, 58, 237, 0.1);
    --card-radius: 18px;
    --tr: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-card: #ffffff;
    --bg-card-alpha: rgba(255, 255, 255, 0.84);
    --text-primary: #1e1b4b;
    --text-secondary: #6b7280;
    --border-color: #e5e4f0;
    --input-bg: #ffffff;
    --shadow-card:
        0 1px 3px rgba(30, 27, 75, 0.05), 0 0 0 1px rgba(79, 70, 229, 0.04);
    --shadow-hover:
        0 8px 28px var(--indigo-shadow), 0 0 0 1.5px var(--indigo-border);
    --overlay-dark: rgba(15, 12, 40, 0.6);

    /* Alias para compatibilidad con auth.js existente */
    --green: #4f46e5;
    --green-hover: #4338ca;
    --green-soft: rgba(79, 70, 229, 0.1);
    --green-glow: rgba(79, 70, 229, 0.22);
    --green-border: rgba(79, 70, 229, 0.2);
}

html.dark-mode {
    --bg-card: #13111f;
    --bg-card-alpha: rgba(19, 17, 31, 0.88);
    --text-primary: #e8e7f5;
    --text-secondary: #9ca3af;
    --border-color: #1f1d33;
    --input-bg: #1a1828;
    --indigo-soft: rgba(79, 70, 229, 0.14);
    --indigo-glow: rgba(79, 70, 229, 0.28);
    --indigo-shadow: rgba(79, 70, 229, 0.15);
    --indigo-border: rgba(79, 70, 229, 0.28);
    --violet-soft: rgba(124, 58, 237, 0.14);
    --shadow-card:
        0 1px 3px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(79, 70, 229, 0.06);
    --shadow-hover:
        0 8px 30px rgba(79, 70, 229, 0.14), 0 0 0 1.5px rgba(79, 70, 229, 0.26);
    --overlay-dark: rgba(8, 6, 22, 0.8);
    --green-soft: rgba(79, 70, 229, 0.14);
    --green-glow: rgba(79, 70, 229, 0.28);
    --green-border: rgba(79, 70, 229, 0.28);
}

* {
    font-family: "Poppins", sans-serif;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-primary);
    transition: color var(--tr);
    overflow-x: hidden;
}

/* ===== FONDO — parque / mascotas ===== */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    /* Parque con perros: imagen de parque al atardecer */
    background: url("https://images.unsplash.com/photo-1548199973-03cce0bbc87b?w=1920&q=80")
        center/cover no-repeat;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--overlay-dark);
    backdrop-filter: blur(5px);
    transition: background var(--tr);
}

/* ===== WRAPPER ===== */
.auth-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ===== CARD ===== */
.auth-card {
    width: 100%;
    max-width: 444px;
    background: var(--bg-card-alpha);
    backdrop-filter: blur(22px) saturate(1.5);
    border: 1.5px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow:
        0 20px 60px rgba(15, 12, 40, 0.22),
        0 0 0 1px rgba(79, 70, 229, 0.07);
    overflow: hidden;
    transition: all var(--tr);
    animation: cardIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Barra superior gradiente índigo→violeta */
.auth-card::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--indigo), var(--violet), #c084fc);
}

.auth-body {
    padding: 2rem 2rem 1.75rem;
}

/* ===== LOGO / BRAND ===== */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.35rem;
}

.auth-brand .brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.23rem;
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.38);
}

.auth-brand span {
    font-weight: 800;
    font-size: 1.28rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

/* ===== TABS ===== */
.auth-tabs {
    display: flex;
    gap: 0;
    background: var(--input-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.75rem;
    transition: all var(--tr);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--tr);
    border: 1.5px solid transparent;
    user-select: none;
}
.auth-tab:hover {
    color: var(--text-primary);
}
.auth-tab.active {
    background: var(--bg-card);
    color: var(--indigo);
    border-color: var(--indigo-border);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

/* ===== FORMULARIOS ===== */
.auth-form {
    display: none;
}
.auth-form.active {
    display: block;
    animation: fadeForm 0.35s ease forwards;
}
@keyframes fadeForm {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.form-control {
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 0.62rem 0.9rem;
    font-size: 0.93rem;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--tr);
}
.form-control::placeholder {
    color: var(--text-secondary);
}
.form-control:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px var(--indigo-soft);
    background: var(--input-bg);
    color: var(--text-primary);
}

.input-icon-wrap {
    position: relative;
}
.input-icon-wrap .input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.98rem;
    transition: color var(--tr);
    pointer-events: none;
}
.input-icon-wrap .form-control {
    padding-left: 2.5rem;
}
.input-icon-wrap:focus-within .input-icon {
    color: var(--indigo);
}

.input-toggle-pw {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.08rem;
    padding: 0;
    transition: color var(--tr);
}
.input-toggle-pw:hover {
    color: var(--indigo);
}

/* ===== CHECKBOX ===== */
.check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.custom-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--text-secondary);
    user-select: none;
}
.custom-check input {
    display: none;
}
.custom-check .checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr);
    flex-shrink: 0;
}
.custom-check .checkmark i {
    font-size: 0.73rem;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--tr);
}
.custom-check input:checked + .checkmark {
    background: var(--indigo);
    border-color: var(--indigo);
}
.custom-check input:checked + .checkmark i {
    opacity: 1;
    transform: scale(1);
}

.link-subtle {
    font-size: 0.86rem;
    color: var(--indigo);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--tr);
}
.link-subtle:hover {
    color: var(--indigo-hover);
    text-decoration: underline;
}

/* ===== BOTONES ===== */
.btn-green {
    width: 100%;
    padding: 0.68rem;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 600;
    transition: all var(--tr);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.btn-green:hover {
    background: linear-gradient(135deg, var(--indigo-hover), var(--indigo));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(79, 70, 229, 0.38);
}
.btn-green:active {
    transform: translateY(0);
}

.btn-orange {
    width: 100%;
    padding: 0.68rem;
    background: linear-gradient(135deg, var(--violet), #c084fc);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 600;
    transition: all var(--tr);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-orange:hover {
    background: linear-gradient(135deg, var(--violet-hover), var(--violet));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(124, 58, 237, 0.38);
}
.btn-orange:active {
    transform: translateY(0);
}

.btn-google {
    width: 100%;
    padding: 0.68rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 600;
    transition: all var(--tr);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.btn-google:hover {
    border-color: var(--indigo-border);
    background: var(--indigo-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
.btn-google .google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.divider span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* ===== PASSWORD STRENGTH ===== */
.pw-strength {
    margin-top: 0.4rem;
}
.pw-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 0.25rem;
}
.pw-bars .bar {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--border-color);
    transition: background 0.3s ease;
}
.pw-strength .pw-label {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* ===== FOOTER AUTH ===== */
.auth-footer {
    padding: 0 2rem 1.5rem;
    text-align: center;
}
.auth-footer p {
    font-size: 0.83rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== TEMA TOGGLE FIJO ===== */
.theme-float {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-card-alpha);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.18rem;
    transition: all var(--tr);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}
.theme-float:hover {
    border-color: var(--indigo-border);
    color: var(--indigo);
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.18);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}
.custom-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.88rem 1.3rem;
    border-radius: 12px;
    background: #1e1b4b;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(79, 70, 229, 0.28);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
}
.custom-toast.show {
    transform: translateX(0);
}
.custom-toast .toast-icon {
    font-size: 1.18rem;
}
.custom-toast .toast-icon.success {
    color: #a5b4fc;
}
.custom-toast .toast-icon.error {
    color: #f43f5e;
}

/* ===== VALIDACIÓN ===== */
.field-error {
    font-size: 0.78rem;
    color: #f43f5e;
    font-weight: 500;
    margin-top: 0.3rem;
    display: none;
}
.field-error.visible {
    display: block;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

.form-control.is-invalid {
    border-color: #f43f5e;
}
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

/* ===== LOADING SPINNER ===== */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}
.btn-green.loading .btn-text,
.btn-orange.loading .btn-text,
.btn-google.loading .btn-text {
    display: none;
}
.btn-green.loading .btn-spinner,
.btn-orange.loading .btn-spinner,
.btn-google.loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .auth-body {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    .auth-footer {
        padding: 0 1.25rem 1.25rem;
    }
    .auth-card {
        border-radius: 16px;
    }
}

/* ===== DECORATIVE CIRCLES ===== */
.deco-circle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.deco-circle-1 {
    width: 380px;
    height: 380px;
    bottom: -130px;
    left: -90px;
    background: radial-gradient(
        circle,
        rgba(79, 70, 229, 0.09) 0%,
        transparent 70%
    );
}
.deco-circle-2 {
    width: 280px;
    height: 280px;
    top: -70px;
    right: -50px;
    background: radial-gradient(
        circle,
        rgba(124, 58, 237, 0.07) 0%,
        transparent 70%
    );
}
html.dark-mode .deco-circle-1 {
    background: radial-gradient(
        circle,
        rgba(79, 70, 229, 0.05) 0%,
        transparent 70%
    );
}
html.dark-mode .deco-circle-2 {
    background: radial-gradient(
        circle,
        rgba(124, 58, 237, 0.04) 0%,
        transparent 70%
    );
}

/* ===== SUCCESS STATE ===== */
.auth-card.success-state .auth-body,
.auth-card.success-state .auth-footer {
    display: none;
}

.success-view {
    display: none;
    padding: 3rem 2rem;
    text-align: center;
}
.auth-card.success-state .success-view {
    display: block;
    animation: fadeForm 0.4s ease forwards;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--indigo-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.95rem;
    color: var(--indigo);
    animation: popIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-view h4 {
    font-weight: 700;
    font-size: 1.23rem;
    margin-bottom: 0.5rem;
}
.success-view p {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin-bottom: 1.5rem;
}

.auth-hint {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 12px;
}
