/* Public area — modo día Elura (tokens = UiSettingsManager defaults light) */
:root {
    /* Mismos valores que el panel en modo claro */
    --body-bg: #f1f5f9;
    --content-bg: #ffffff;
    --ui-card-bg: #ffffff;
    --border-color: #e2e8f0;
    --color-primary: #3b82f6;
    --color-secondary: #2563eb;
    --color-button: #2563eb;

    --bg0: var(--body-bg);
    --bg1: #e8eef7;
    --card: var(--ui-card-bg);
    --card-border: var(--border-color);
    --text: #0f172a;
    --muted: #64748b;
    --muted2: #334155;
    --brand: var(--color-primary);
    --brand2: var(--color-secondary);
    --brand-ring: rgba(59, 130, 246, 0.18);
    --danger: #e11d48;
    --danger-bg: #fff1f2;
    --danger-border: #fecdd3;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--body-bg);
}

.card {
    width: 100%;
    max-width: 440px;
    padding: 28px 28px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    background: var(--card);
    box-shadow: var(--shadow);
}

.card--auth {
    position: relative;
}

/* Language switcher */
.public-lang {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    margin: 0 0 16px;
    font-size: 0.8125rem;
    line-height: 1.2;
}

.public-lang a {
    color: var(--muted);
    text-decoration: none;
    transition: color 120ms ease;
}

.public-lang a:hover,
.public-lang a:focus-visible {
    color: var(--brand);
}

.public-lang__sep {
    margin: 0 0.35rem;
    color: #cbd5e1;
}

.public-lang__current {
    color: var(--brand);
    font-weight: 650;
}

h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.9375rem;
}

.field {
    margin-bottom: 14px;
}

.field--remember {
    margin-bottom: 18px;
}

.remember-me {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-weight: 600;
    color: var(--muted2);
    font-size: 0.875rem;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    accent-color: var(--brand);
    flex: 0 0 auto;
}

.remember-me__help {
    margin: 6px 0 0 26px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted);
}


label,
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--muted2);
    font-size: 0.875rem;
}

input[type="email"],
input[type="text"],
input[type="password"],
.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    font: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder,
.form-control::placeholder {
    color: #94a3b8;
}

input:focus,
.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
    background: #ffffff;
}

.cf-turnstile {
    margin: 4px 0 14px;
}

.error,
.alert-danger {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 0.9rem;
    line-height: 1.35;
}

button,
.btn-primary {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 0;
    background: var(--color-button);
    color: #ffffff;
    font-weight: 650;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 120ms ease, filter 120ms ease, transform 80ms ease;
}

button:hover,
.btn-primary:hover {
    background: var(--brand2);
    filter: brightness(0.97);
}

button:active,
.btn-primary:active {
    transform: translateY(1px);
}

button.secondary {
    background: #ffffff;
    border: 1px solid var(--input-border);
    color: var(--text);
    font-weight: 600;
    box-shadow: none;
}

button.secondary:hover {
    filter: none;
    background: #f8fafc;
    border-color: #94a3b8;
}

.mb-3 {
    margin-bottom: 1rem;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

/* Footer */
.elura-footer {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--muted);
}

.elura-footer__credit,
.elura-footer__copyright {
    display: inline-block;
    margin: 0;
    flex: 0 1 auto;
}

.elura-footer__credit {
    margin-left: auto;
    text-align: right;
}

.elura-footer__link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.elura-footer__link:hover,
.elura-footer__link:focus-visible {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .elura-footer {
        flex-direction: column !important;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .elura-footer__credit {
        margin-left: 0;
        text-align: left;
    }
}

/* —— Error pages —— */
body.error-page {
    position: relative;
    overflow: hidden;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.error-page__glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: error-glow-in 1.1s ease forwards;
}

.error-page__glow--a {
    width: min(70vw, 520px);
    height: min(70vw, 520px);
    top: -12%;
    left: -8%;
    background: rgba(59, 130, 246, 0.12);
}

.error-page__glow--b {
    width: min(55vw, 420px);
    height: min(55vw, 420px);
    bottom: -18%;
    right: -6%;
    background: rgba(37, 99, 235, 0.08);
    animation-delay: 0.15s;
}

.error-page__main {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(28px, 6vw, 64px);
    max-width: 720px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(12px);
    animation: error-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.error-page__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    margin-bottom: clamp(28px, 5vh, 48px);
}

.error-page__logo {
    display: block;
    width: min(172px, 52vw);
    height: auto;
    border-radius: 0;
    box-shadow: none;
}

.error-page__code {
    margin: 0 0 8px;
    font-size: clamp(4.5rem, 18vw, 8rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.06em;
    background: linear-gradient(180deg, #93c5fd 0%, var(--brand) 55%, var(--brand2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: error-float 5.5s ease-in-out infinite;
}

.error-page__title {
    margin: 0 0 12px;
    font-size: clamp(1.45rem, 3.5vw, 1.85rem);
    font-weight: 750;
    letter-spacing: -0.025em;
    color: var(--text);
}

.error-page__text {
    margin: 0 0 28px;
    max-width: 36rem;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.55;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.error-page__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 11px 18px;
    border-radius: 8px;
    font-weight: 650;
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.01em;
    cursor: pointer;
    font-family: inherit;
    transition: filter 120ms ease, transform 80ms ease, background 120ms ease, border-color 120ms ease;
}

.error-page__btn--primary {
    background: var(--color-button);
    color: #ffffff;
    border: 0;
}

.error-page__btn--primary:hover { filter: brightness(0.97); }
.error-page__btn--primary:active { transform: translateY(1px); }

.error-page__btn--ghost {
    background: #ffffff;
    color: var(--muted2);
    border: 1px solid var(--card-border);
}

.error-page__btn--ghost:hover {
    color: var(--text);
    border-color: #94a3b8;
    background: #f8fafc;
}

@keyframes error-glow-in {
    to { opacity: 1; }
}

@keyframes error-rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes error-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.error-page__glow--warm {
    background: rgba(251, 146, 60, 0.14);
}

.error-page__glow--amber {
    background: rgba(245, 158, 11, 0.16);
}

.error-page__code--5xx {
    background: linear-gradient(180deg, #fed7aa 0%, #fb923c 50%, #ea580c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-page__code--warn {
    background: linear-gradient(180deg, #fde68a 0%, #f59e0b 55%, #d97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .error-page__glow,
    .error-page__main,
    .error-page__code {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
