/* ── Fondo con gradientes radiales ─────────────────────────────────────── */
.login-bg {
    background-color: hsl(225, 70%, 14%);
    background-image:
        radial-gradient(900px circle at 5% 10%,
            hsl(230, 75%, 38%) 10%,
            hsl(230, 70%, 30%) 30%,
            hsl(230, 65%, 22%) 65%,
            transparent 100%),
        radial-gradient(1100px circle at 95% 90%,
            hsl(265, 65%, 42%) 5%,
            hsl(265, 60%, 32%) 30%,
            hsl(265, 55%, 22%) 65%,
            transparent 100%);
    background-attachment: fixed;
}

/* ── Formas flotantes orgánicas ───────────────────────────────────────── */
.login-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.login-shape-1 {
    position: absolute;
    width: 280px;
    height: 280px;
    top: -80px;
    left: -100px;
    background: radial-gradient(
        hsl(230, 80%, 50%) 0%,
        hsl(230, 70%, 65%) 60%,
        transparent 100%
    );
    border-radius: 50%;
    opacity: 0.45;
    filter: blur(40px);
}

.login-shape-2 {
    position: absolute;
    width: 360px;
    height: 360px;
    bottom: -100px;
    right: -120px;
    background: radial-gradient(
        hsl(265, 70%, 50%) 0%,
        hsl(270, 60%, 60%) 50%,
        transparent 100%
    );
    border-radius: 35% 65% 60% 40% / 55% 40% 60% 45%;
    opacity: 0.4;
    filter: blur(45px);
    transform: rotate(-15deg);
}

.login-shape-3 {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 40%;
    right: 10%;
    background: radial-gradient(
        hsl(200, 80%, 55%) 0%,
        hsl(210, 70%, 45%) 60%,
        transparent 100%
    );
    border-radius: 60% 40% 50% 50% / 45% 55% 45% 55%;
    opacity: 0.3;
    filter: blur(50px);
    transform: rotate(20deg);
}

/* ── Reset & Body ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
}

/* ── Wrapper ──────────────────────────────────────────────────────────── */
.login-wrapper,
.wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 24px 16px;
}

/* ── Brand ─────────────────────────────────────────────────────────────── */
.login-brand,
.brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-brand-top,
.brand-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.login-brand-icon,
.brand-icon {
    width: 64px;
    height: 64px;
}
.login-brand-icon img,
.brand-icon img {
    width: 100%;
    height: 100%;
}
.login-brand-name,
.brand-name {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.login-brand-sub,
.brand-sub {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* ── Card (glassmorphism) ─────────────────────────────────────────────── */
.login-card,
.card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-card h1,
.card h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #fff;
}

.card .subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 22px;
    line-height: 1.5;
}

/* ── Form fields ──────────────────────────────────────────────────────── */
.field {
    margin-bottom: 16px;
}
.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.8);
}
.field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.field input:focus {
    border-color: hsl(220, 90%, 65%);
    box-shadow: 0 0 0 3px rgba(100, 150, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}
.field input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.field input.invalid {
    border-color: rgba(231, 76, 60, 0.6);
}

/* ── Messages (error / success) ──────────────────────────────────────── */
.error-msg,
.msg {
    display: none;
    border-radius: 7px;
    padding: 10px 13px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.error-msg.visible,
.msg.visible {
    display: block;
}
.error-msg,
.msg.error {
    background: rgba(231, 76, 60, 0.2);
    color: #ff8a80;
    border: 1px solid rgba(231, 76, 60, 0.35);
}
.msg.success {
    background: rgba(46, 204, 113, 0.15);
    color: #69f0ae;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

/* ── Turnstile ────────────────────────────────────────────────────────── */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-login,
.btn-submit {
    width: 100%;
    padding: 11px;
    background: hsl(220, 85%, 55%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.2px;
    margin-top: 4px;
}
.btn-login:hover:not(:disabled),
.btn-submit:hover:not(:disabled) {
    background: hsl(220, 85%, 48%);
}
.btn-login:disabled,
.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.login-footer,
.footer-links {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}
.login-footer a,
.footer-links a {
    color: hsl(210, 90%, 72%);
    text-decoration: none;
}
.login-footer a:hover,
.footer-links a:hover {
    text-decoration: underline;
}

/* ── Success panel ───────────────────────────────────────────────────── */
.success-panel {
    display: none;
    text-align: center;
}
.success-panel .check {
    font-size: 48px;
    margin-bottom: 12px;
}
.success-panel h2 {
    font-size: 18px;
    font-weight: 600;
    color: #69f0ae;
    margin-bottom: 8px;
}
.success-panel p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
}
.success-panel .login-link {
    display: inline-block;
    margin-top: 20px;
    padding: 11px 28px;
    background: hsl(220, 85%, 55%);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.success-panel .login-link:hover {
    background: hsl(220, 85%, 48%);
}

/* ── No-token panel (reset-password) ─────────────────────────────────── */
.no-token {
    text-align: center;
}
.no-token .icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.no-token h1 {
    color: #ff8a80 !important;
}
.no-token p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin: 12px 0 20px;
}
.no-token .btn-submit {
    display: inline-block;
    width: auto;
    padding: 11px 28px;
    text-decoration: none;
}

/* ── 2FA panel tweaks ─────────────────────────────────────────────────── */
#panel-2fa {
    display: none;
}
#panel-2fa p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}
#panel-2fa label {
    color: rgba(255, 255, 255, 0.7);
}
#panel-2fa .trust-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
    cursor: pointer;
}
#trust-device {
    width: auto;
}
#totp-code {
    text-align: center;
    font-size: 20px;
    letter-spacing: 6px;
    font-weight: 600;
}
#btn-login {
    margin-top: 12px;
}
.back-link-wrap {
    text-align: center;
    margin-top: 14px;
}
#link-back-login {
    color: hsl(210, 90%, 72%) !important;
    text-decoration: none;
    font-size: 13px;
}
#link-back-login:hover {
    text-decoration: underline;
}
.site-footer {
    font-size: 12px;
    color: #aaa;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    body { min-height: 100dvh; }
    .login-brand, .brand { margin-bottom: 16px; }
    .login-card, .card { padding: 24px 20px; }
}
