/* AppSocios - Portal del socio (estilo login como ASPREG) */
:root {
    --bs-primary: #0f766e;
    --color-bg: #f8fafc;
    --color-text: #1e293b;
    --login-bg: #0a1628;
    --login-bg-mid: #0f2847;
    --login-bg-soft: #132f4c;
    --login-accent: #2563eb;
    --login-accent-hover: #1d4ed8;
    --login-accent-soft: rgba(37, 99, 235, 0.15);
    --login-card-bg: #ffffff;
    --login-card-border: rgba(148, 163, 184, 0.18);
    --login-text: #0f172a;
    --login-text-muted: #475569;
    --login-input-border: #e2e8f0;
    --login-input-focus: #2563eb;
    --login-safe-bottom: env(safe-area-inset-bottom, 0px);
    --login-safe-top: env(safe-area-inset-top, 0px);
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

/* Toast */
.toast-host {
    position: fixed;
    top: calc(20px + var(--login-safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: calc(100% - 32px);
    max-width: 380px;
    pointer-events: none;
}
.toast-host .toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast-host .toast.toast--visible { opacity: 1; transform: translateY(0) scale(1); }
.toast-host .toast.toast--out { opacity: 0; transform: translateY(-8px) scale(0.98); }
.toast--error {
    background: #fff;
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.25);
}
.toast-icon-wrap { flex-shrink: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: #b91c1c; }
.toast-icon-wrap .toast-icon { width: 26px; height: 26px; stroke-width: 2.5; }
.toast--success .toast-icon-wrap { color: #16a34a; }
.toast-message { flex: 1; min-width: 0; }
.toast-dismiss {
    flex-shrink: 0; width: 36px; height: 36px; padding: 0; border: none;
    background: transparent !important; box-shadow: none !important; color: #7f1d1d;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.2s;
}
.toast-dismiss:hover, .toast-dismiss:focus { color: #991b1b; outline: none; }
@media (min-width: 769px) {
    .toast-host { left: auto; right: 24px; top: 24px; transform: none; max-width: 360px; }
}

/* Login página */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--login-bg);
    background-image:
        radial-gradient(ellipse 120% 100% at 50% -20%, var(--login-bg-soft) 0%, transparent 50%),
        linear-gradient(165deg, var(--login-bg) 0%, var(--login-bg-mid) 45%, var(--login-bg) 100%);
    position: relative;
    overflow-x: hidden;
}
.login-wrapper { position: relative; z-index: 1; width: 100%; max-width: 440px; }
.login-bg-pattern {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(37, 99, 235, 0.06) 0%, transparent 45%);
    pointer-events: none;
}
.login-card {
    background: var(--login-card-bg);
    border-radius: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 24px 48px -12px rgba(0, 0, 0, 0.22);
    padding: 48px 44px 36px;
    border: 1px solid var(--login-card-border);
}
.login-brand { text-align: center; margin-bottom: 36px; }
.login-logo {
    width: 120px; height: 120px; max-width: 100%; object-fit: contain;
    display: block; margin: 0 auto 20px;
}
.login-title { margin: 0 0 8px; font-size: 1.625rem; font-weight: 700; color: var(--login-text); letter-spacing: -0.04em; }
.login-subtitle { margin: 0; font-size: 0.875rem; color: var(--login-text-muted); font-weight: 500; }

.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--login-text); margin-bottom: 8px; }
.login-form input {
    width: 100%; padding: 14px 16px; border: 1px solid var(--login-input-border); border-radius: 12px;
    font-size: 0.9375rem; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box; background: #fff;
}
.login-form .password-field input { padding-right: 52px; }
.login-form input::placeholder { color: #94a3b8; }
.login-form input:hover { border-color: #cbd5e1; }
.login-form input:focus {
    outline: none; border-color: var(--login-input-focus); box-shadow: 0 0 0 3px var(--login-accent-soft);
}
.btn-login {
    width: 100%; padding: 16px 20px; margin-top: 12px;
    background: linear-gradient(180deg, var(--login-accent) 0%, var(--login-accent-hover) 100%);
    color: #fff; border: none; border-radius: 14px; font-size: 1rem; font-weight: 600; font-family: inherit;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: box-shadow 0.2s, transform 0.1s, filter 0.2s;
}
.btn-login:hover { box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4); filter: brightness(1.05); }
.btn-login:active { transform: scale(0.99); }
.btn-login-icon { width: 20px; height: 20px; flex-shrink: 0; }

.login-footer { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--login-input-border); }
.login-footer-text { text-align: center; margin: 0; font-size: 0.75rem; color: var(--login-text-muted); font-weight: 500; }

.password-field { position: relative; display: block; }
.password-field input { padding-right: 52px; }
.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: none; background: transparent !important; box-shadow: none !important;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
    border-radius: 0; color: #0f172a; transition: color 0.2s;
}
.toggle-password .icon-eye, .toggle-password .icon-eye-off { width: 26px; height: 26px; display: block; flex-shrink: 0; }
.toggle-password .icon-eye-off { display: none !important; }
.toggle-password .icon-eye { display: block !important; }
.toggle-password.is-active .icon-eye { display: none !important; }
.toggle-password.is-active .icon-eye-off { display: block !important; }
.toggle-password:hover { color: var(--login-accent); background: transparent !important; }
.toggle-password:focus, .toggle-password:focus-visible { outline: none; background: transparent !important; box-shadow: none !important; }
.toggle-password.is-active { color: var(--login-accent); }

@media (max-width: 768px) {
    .login-page {
        padding: 16px;
        padding-top: calc(24px + var(--login-safe-top));
        padding-bottom: calc(24px + var(--login-safe-bottom));
        align-items: flex-start;
    }
    .login-wrapper { max-width: 100%; flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
    .login-card {
        padding: 36px 24px 28px; border-radius: 28px; border-width: 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08), 0 24px 48px -12px rgba(0, 0, 0, 0.15);
        flex: 0 1 auto;
    }
    .login-brand { margin-bottom: 28px; }
    .login-logo { width: 110px; height: 110px; margin-bottom: 18px; }
    .login-title { font-size: 1.5rem; }
    .login-subtitle { font-size: 0.8125rem; }
    .login-form input { padding: 16px 18px; border-radius: 14px; font-size: 16px; min-height: 52px; }
    .login-form .password-field input { padding-right: 56px; }
    .btn-login { padding: 18px 20px; border-radius: 14px; min-height: 54px; margin-top: 16px; }
    .toggle-password { width: 48px; height: 48px; right: 8px; }
    .toggle-password .icon-eye, .toggle-password .icon-eye-off { width: 26px; height: 26px; }
    .login-footer { margin-top: 24px; padding-top: 20px; }
    .toast-host { width: calc(100% - 24px); max-width: none; }
}

/* Dashboard y resto (Bootstrap-like) */
.btn-primary { background-color: #0f766e !important; border-color: #0f766e !important; }
.btn-primary:hover { background-color: #0d9488 !important; border-color: #0d9488 !important; }
.navbar-logo { object-fit: contain; flex-shrink: 0; }
