/* LoginKadevia — pantallas de login y doble factor (diseño Kadevia, opción B:
   pantalla completa azul marino, logo centrado sobre tarjeta blanca y el doble
   chevrón del logotipo grande y tenue detrás) */

:root {
    --kdv-navy: #0f172a;
    --kdv-teal-mid: #0bb8a8;
    --kdv-teal-dark: #0a9a8a;
    --kdv-bg: #f6f8fb;
    --kdv-text: #11142d;
    --kdv-muted: #777e89;
    --kdv-faint: #a3aab5;
    --kdv-border: #d9dee5;
}

html, body.kdv-body {
    height: 100%;
}

body.kdv-body {
    margin: 0;
    background: var(--kdv-navy);
    color: var(--kdv-text);
    font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ─── Fondo y pila central ───────────────────────────────────── */
.kdv-bg {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    padding: 48px 24px;
    background: var(--kdv-navy);
}

/* doble chevrón del logotipo (4 trazados del SVG oficial) */
.kdv-bg-motif {
    position: absolute;
    left: -420px;
    top: -180px;
    width: 1180px;
    height: 1018px;
    opacity: 0.10;
    pointer-events: none;
}

.kdv-stack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    width: 100%;
    max-width: 440px;
}

.kdv-logo-link {
    display: block;
    width: 240px;
    max-width: 70%;
}

.kdv-logo {
    width: 100%;
    height: auto;
    display: block;
}

.kdv-caption {
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0.06em;
    color: #64748b;
}

/* ─── Tarjeta / formulario ───────────────────────────────────── */
.kdv-card {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.kdv-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kdv-title {
    margin: 0;
    font-family: Outfit, Roboto, sans-serif;
    font-size: 26px;
    line-height: 32px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--kdv-navy);
}

.kdv-subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 22px;
    color: var(--kdv-muted);
}

.kdv-subtitle strong {
    font-weight: 500;
    color: var(--kdv-text);
}

.kdv-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 6px;
    border-radius: 14px;
    background: rgba(11, 184, 168, 0.12);
    color: var(--kdv-teal-dark);
}

.kdv-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.kdv-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kdv-label {
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: var(--kdv-text);
}

.kdv-control {
    position: relative;
    display: flex;
    align-items: center;
}

.kdv-control-icon {
    position: absolute;
    left: 16px;
    display: flex;
    color: var(--kdv-muted);
    pointer-events: none;
}

.kdv-input {
    display: block;
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    padding: 0 16px 0 48px;
    background: #ffffff;
    border: 1px solid var(--kdv-border);
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
    line-height: 24px;
    color: var(--kdv-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.kdv-input::placeholder {
    color: var(--kdv-faint);
}

.kdv-input:focus {
    border-color: var(--kdv-teal-mid);
    box-shadow: 0 0 0 1px var(--kdv-teal-mid), 0 0 0 5px rgba(11, 184, 168, 0.15);
}

.kdv-input.kdv-has-toggle {
    padding-right: 52px;
}

.kdv-toggle {
    position: absolute;
    right: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--kdv-muted);
    cursor: pointer;
}

.kdv-toggle:hover {
    background: var(--kdv-bg);
    color: var(--kdv-navy);
}

.kdv-toggle .kdv-eye-off {
    display: none;
}

.kdv-toggle.is-visible .kdv-eye-on {
    display: none;
}

.kdv-toggle.is-visible .kdv-eye-off {
    display: block;
}

/* código 2FA */
.kdv-input.kdv-code {
    height: 64px;
    padding: 0 16px;
    text-align: center;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 30px;
    line-height: 36px;
    letter-spacing: 0.42em;
    text-indent: 0.42em;
}

.kdv-hint {
    font-size: 13px;
    line-height: 18px;
    color: var(--kdv-faint);
}

.kdv-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kdv-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
    color: #ffffff;
    font-family: Outfit, Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 20px rgba(11, 184, 168, 0.28);
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
}

.kdv-btn:hover {
    filter: brightness(0.96);
    box-shadow: 0 10px 24px rgba(11, 184, 168, 0.34);
}

.kdv-btn:active {
    transform: translateY(1px);
}

.kdv-btn:focus-visible {
    outline: 3px solid rgba(11, 184, 168, 0.4);
    outline-offset: 2px;
}

.kdv-link {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

.kdv-link a,
.kdv-link button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--kdv-teal-dark);
    text-decoration: none;
    cursor: pointer;
}

.kdv-link a:hover,
.kdv-link button:hover {
    color: var(--kdv-navy);
    text-decoration: underline;
}

/* ─── Mensajes (MiniLog) ─────────────────────────────────────── */
.kdv-alerts:empty,
.kdv-alerts:not(:has(.alert)) {
    display: none;
}

.kdv-alerts .alert {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 12px 40px 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 20px;
    color: var(--kdv-text);
}

.kdv-alerts .alert-warning,
.kdv-alerts .alert-danger {
    background: #fff4f6;
    border: 1px solid #fbc9d3;
}

.kdv-alerts .alert-success {
    background: #e8faf3;
    border: 1px solid #b7ecd8;
}

.kdv-alerts .alert-info {
    background: #eef6fb;
    border: 1px solid #c9e2f2;
}

.kdv-alerts .btn-close {
    top: 10px;
    right: 10px;
    padding: 6px;
}

/* ─── Modal cambio de contraseña (Bootstrap) ─────────────────── */
.kdv-modal .modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.kdv-modal .modal-header {
    border-bottom: 0;
    padding: 24px 24px 8px;
}

.kdv-modal .modal-title {
    font-family: Outfit, Roboto, sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--kdv-navy);
}

.kdv-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 24px 16px;
}

.kdv-modal .modal-footer {
    border-top: 0;
    padding: 0 24px 24px;
}

.kdv-modal .kdv-modal-help {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--kdv-muted);
}

/* ─── Móvil ──────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .kdv-bg {
        justify-content: flex-start;
        padding: 56px 20px 32px;
    }

    .kdv-bg-motif {
        left: auto;
        right: -200px;
        top: -120px;
        width: 520px;
        height: 449px;
        opacity: 0.12;
    }

    .kdv-stack {
        gap: 28px;
        max-width: none;
    }

    .kdv-logo-link {
        width: 180px;
        max-width: 60%;
    }

    .kdv-card {
        gap: 24px;
        padding: 28px 24px;
    }

    .kdv-title {
        font-size: 24px;
        line-height: 30px;
    }

    .kdv-btn {
        height: 52px;
    }

    .kdv-caption {
        display: none;
    }
}
