/* =========================================================
   LOGIN — PROTEOS BIOTECH — INTRANET DISTRIBUIDORES
========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
    --brand-dark:      #3b1e14;
    --brand-mid:       #7a3320;
    --brand-accent:    #fe8260;
    --brand-light:     #f99875;
    --brand-glow:      rgba(254, 130, 96, 0.28);

    --bg-page:         linear-gradient(135deg, #6e2a12 0%, #46180a 55%, #38130a 100%);
    --bg-card:         linear-gradient(160deg, #fe8260 0%, #fe8260 100%);
    --bg-input:        rgba(255,255,255,0.14);
    --bg-input-focus:  rgba(255,255,255,0.22);

    --text-primary:    #ffffff;
    --text-soft:       rgba(255,255,255,0.88);
    --text-label:      rgba(255,255,255,0.96);

    --border-subtle:   rgba(255,255,255,0.22);
    --border-input:    rgba(255,255,255,0.30);
    --border-focus:    rgba(255,255,255,0.85);

    --danger:          #f87171;
    --danger-bg:       rgba(248, 113, 113, 0.12);
    --danger-border:   rgba(248, 113, 113, 0.30);

    --success-bg:      rgba(52, 211, 153, 0.12);
    --success-border:  rgba(52, 211, 153, 0.30);
    --success-text:    #6ee7b7;

    --radius-md:  16px;
    --radius-lg:  24px;
    --radius-xl:  32px;

    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);

    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── FONDO ANIMADO ───────────────────────────────────── */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(254,130,96,0.25) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
    animation: bgShift 20s linear infinite;
}

@keyframes bgShift {
    from { background-position: 0 0; }
    to   { background-position: 72px 72px; }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: orbFloat 12s ease-in-out infinite;
}

.orb--1 {
    width: 520px; height: 520px;
    top: -160px; left: -120px;
    background: radial-gradient(circle, #fe8260 0%, transparent 70%);
    animation-duration: 14s;
}

.orb--2 {
    width: 400px; height: 400px;
    bottom: -100px; right: -80px;
    background: radial-gradient(circle, #fe8260 0%, #fe8260 50%, transparent 80%);
    animation-duration: 11s;
    animation-delay: -4s;
}

.orb--3 {
    width: 280px; height: 280px;
    top: 40%; left: 55%;
    background: radial-gradient(circle, #f99875 0%, transparent 70%);
    opacity: 0.18;
    animation-duration: 18s;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(20px, -30px) scale(1.05); }
    66%       { transform: translate(-15px, 15px) scale(0.96); }
}

/* ─── LAYOUT CENTRADO ─────────────────────────────────── */
.login-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ─── TARJETA ─────────────────────────────────────────── */
.login-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 40px 38px;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid rgba(254,130,96,0.20);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 40px 80px rgba(0,0,0,0.45),
        0 0 60px rgba(254,130,96,0.08);
    backdrop-filter: blur(24px);
    animation: cardReveal 0.8s var(--ease-spring) both;
    overflow: hidden;
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Línea superior brillante */
.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--brand-accent) 30%,
        var(--brand-light) 60%,
        transparent 100%);
    animation: shimmerLine 3s ease-in-out infinite;
}

@keyframes shimmerLine {
    0%   { opacity: 0.5; }
    50%  { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Brillo interior esquina */
.login-card::after {
    content: "";
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(254,130,96,0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── LOGO ────────────────────────────────────────────── */
.login-card__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.login-card__brand img {
    max-width: 200px;
    max-height: 64px;
    object-fit: contain;
    background: #ffffff;
    padding: 10px 16px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    transition: transform 0.3s;
}

.login-card__brand img:hover { transform: translateY(-2px); }

.login-card__brand__fallback {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.login-card__brand__fallback span {
    color: var(--brand-accent);
}

/* ─── CABECERA ────────────────────────────────────────── */
.login-card__header {
    text-align: center;
    margin-bottom: 32px;
}

.login-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    margin-bottom: 16px;
}

.login-card__header h1 {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-card__header p {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.6;
}

/* ─── ALERTAS ─────────────────────────────────────────── */
.login-alert {
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: alertPop 0.3s var(--ease-spring) both;
}

@keyframes alertPop {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-alert--error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

.login-alert--success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.login-alert--error::before  { content: " "; flex-shrink: 0; }
.login-alert--success::before { content: " "; flex-shrink: 0; }

/* ─── FORMULARIO ──────────────────────────────────────── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fieldFadeUp 0.5s var(--ease-out) both;
}

.form-group:nth-child(1) { animation-delay: 0.10s; }
.form-group:nth-child(2) { animation-delay: 0.18s; }
.form-group:nth-child(3) { animation-delay: 0.26s; }

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

.form-group label {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text-label);
    letter-spacing: 0.03em;
}

/* ─── INPUTS ──────────────────────────────────────────── */
.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s;
}

.input-wrap:focus-within .input-icon { opacity: 0.85; }

.input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.2s var(--ease-spring);
}

.input-wrap input::placeholder { color: rgba(255,255,255,0.6); }

/* Ocultar el ojo nativo del navegador (Edge, Chrome, IE) */
input::-ms-reveal,
input::-ms-clear { display: none; }

.input-wrap input:hover {
    border-color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.20);
    transform: translateY(-1px);
}

.input-wrap input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.22), 0 8px 24px rgba(0,0,0,0.14);
    transform: translateY(-2px);
}

/* ─── WRAPPER CAMPO + BOTÓN VER ───────────────────────── */
.pw-toggle-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.pw-toggle-wrap .input-wrap {
    flex: 1;
    min-width: 0;
}

/* ─── BOTÓN MOSTRAR/OCULTAR ───────────────────────────── */
.toggle-password {
    flex-shrink: 0;
    align-self: center;
    height: 52px;
    padding: 0 18px;
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.16);
    color: #ffffff;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.toggle-password:hover {
    background: rgba(255,255,255,0.28);
    color: #ffffff;
    border-color: rgba(255,255,255,0.5);
}

/* ─── FILA RECORDARME / OLVIDÉ ────────────────────────── */
.login-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: -4px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    transition: color 0.2s;
}

.checkbox-inline:hover { color: var(--text-primary); }

.checkbox-inline input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--brand-accent);
    cursor: pointer;
}

.login-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-accent);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.login-link::after {
    content: "";
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 1px;
    background: var(--brand-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease-out);
}

.login-link:hover { color: var(--brand-light); }
.login-link:hover::after { transform: scaleX(1); }

/* ─── BOTÓN SUBMIT ────────────────────────────────────── */
.login-submit {
    position: relative;
    width: 100%;
    height: 54px;
    border: none;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: #fe8260;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
    box-shadow: 0 10px 26px rgba(0,0,0,0.22);
    margin-top: 4px;
    animation: fieldFadeUp 0.5s var(--ease-out) 0.34s both;
}

/* Sweep de brillo */
.login-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.55s ease;
}

.login-submit:hover::before { transform: translateX(100%); }

.login-submit:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.30);
}

.login-submit:active:not(:disabled) {
    transform: translateY(-1px) scale(0.99);
}

.login-submit:disabled {
    opacity: 0.55;
    cursor: wait;
}

.login-submit__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-submit__arrow {
    font-size: 1rem;
    transition: transform 0.25s var(--ease-spring);
}

.login-submit:hover .login-submit__arrow { transform: translateX(5px); }

/* Botón ghost (reenviar código) */
.login-submit--ghost {
    background: rgba(254,130,96,0.10);
    box-shadow: none;
    border: 1px solid rgba(254,130,96,0.28);
}

.login-submit--ghost .login-submit__text { color: #f99875; }

.login-submit--ghost:hover:not(:disabled) {
    background: rgba(254,130,96,0.18);
    box-shadow: 0 8px 20px rgba(254,130,96,0.15);
}

/* Estado de carga */
@keyframes spin { to { transform: rotate(360deg); } }

.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;
}

.login-submit.is-loading .spinner        { display: block; }
.login-submit.is-loading .login-submit__text { opacity: 0.7; }
.login-submit.is-loading .login-submit__arrow { display: none; }

/* ─── SEPARADOR ───────────────────────────────────────── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.25);
}

/* ─── FOOTER ──────────────────────────────────────────── */
.login-card__footer {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.20);
    text-align: center;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.82);
    font-weight: 500;
}

/* ─── ESTADO INVÁLIDO ─────────────────────────────────── */
.is-invalid {
    border-color: rgba(248,113,113,0.65) !important;
    background: rgba(248,113,113,0.06) !important;
    box-shadow: 0 0 0 4px rgba(248,113,113,0.12) !important;
    animation: shake 0.32s ease-in-out;
}

@keyframes shake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-6px) translateY(-2px); }
    40%  { transform: translateX(5px)  translateY(-2px); }
    60%  { transform: translateX(-4px) translateY(-2px); }
    80%  { transform: translateX(3px)  translateY(-2px); }
    100% { transform: translateX(0)    translateY(-2px); }
}

/* ─── CÓDIGO 2FA ──────────────────────────────────────── */
.code-hint {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-soft);
    line-height: 1.55;
    margin-top: -8px;
}

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 22px;
        border-radius: var(--radius-lg);
    }

    .login-card__header h1 { font-size: 1.5rem; }
    .login-form__row { flex-direction: column; align-items: flex-start; }
}

/* Refuerzo de marca: general.css tambien se carga en pantallas de acceso y
   puede apagar el naranja del login. Este bloque mantiene el acceso en naranja. */
:root {
    --smartker-orange: #fe8260;
    --smartker-orange-dark: #fe8260;
    --smartker-orange-soft: #fff4ef;
}

body .login-page {
    background:
        radial-gradient(circle at 18% 12%, rgba(232, 93, 42, .22), transparent 34%),
        radial-gradient(circle at 84% 78%, rgba(185, 68, 30, .16), transparent 30%),
        linear-gradient(135deg, #fff7f3 0%, #ffe3d8 48%, #f8cbb9 100%) !important;
}

body .login-card {
    background: var(--smartker-orange) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 1px solid rgba(185, 68, 30, .28) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.16) inset,
        0 28px 64px rgba(73, 31, 18, .28) !important;
}

body .login-card::before {
    background: #ffffff !important;
    opacity: .38;
}

body .login-card::after {
    background: rgba(255,255,255,.13) !important;
}

body .login-card__header h1,
body .login-card label,
body .login-card__footer,
body .login-card__header p,
body .checkbox-inline,
body .code-hint,
body .otp-hint {
    color: #ffffff !important;
}

body .login-chip {
    background: rgba(255,255,255,.18) !important;
    border-color: rgba(255,255,255,.34) !important;
    color: #ffffff !important;
}

body .login-card input {
    background: rgba(255,255,255,.16) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.30) !important;
}

body .login-card input::placeholder {
    color: rgba(255,255,255,.55) !important;
}

body .login-card input:focus {
    background: rgba(255,255,255,.24) !important;
    border-color: rgba(255,255,255,.70) !important;
    box-shadow: 0 0 0 4px rgba(255,255,255,.18), 0 8px 24px rgba(73,31,18,.18) !important;
}

body .login-submit {
    background: #ffffff !important;
    color: var(--smartker-orange-dark) !important;
    box-shadow: 0 12px 28px rgba(73,31,18,.26) !important;
}

body .login-submit--ghost {
    background: rgba(255,255,255,.14) !important;
    border-color: rgba(255,255,255,.34) !important;
}

body .login-submit--ghost .login-submit__text,
body .login-link {
    color: #ffffff !important;
}

body .login-link::after {
    background: #ffffff !important;
}
