/* =============================================================
   wpin.css — v1.3.1
   Acceso por PIN — DigiJom
   Rediseño completo: mayor presencia en desktop
   ============================================================= */

/* ── Reset y variables ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --wpin-primary      : #2563eb;
    --wpin-primary-h    : #1d4ed8;
    --wpin-primary-light: rgba(37, 99, 235, .10);
    --wpin-primary-ring : rgba(37, 99, 235, .15);
    --wpin-success      : #059669;
    --wpin-success-bg   : #ecfdf5;
    --wpin-success-brd  : #a7f3d0;
    --wpin-error        : #dc2626;
    --wpin-error-bg     : #fef2f2;
    --wpin-error-brd    : #fca5a5;
    --wpin-warn         : #d97706;
    --wpin-warn-bg      : #fffbeb;
    --wpin-warn-brd     : #fde68a;

    --wpin-bg-grad-a    : #e8eeff;
    --wpin-bg-grad-b    : #f0f4ff;
    --wpin-card         : #ffffff;
    --wpin-surface      : #f8fafc;
    --wpin-text         : #0f172a;
    --wpin-muted        : #64748b;
    --wpin-border       : #e2e8f0;
    --wpin-dot-empty    : #dde3f0;
    --wpin-dot-fill     : #2563eb;
    --wpin-dot-ring     : rgba(37, 99, 235, .18);

    --wpin-radius-sm    : 10px;
    --wpin-radius-md    : 14px;
    --wpin-radius-lg    : 20px;
    --wpin-radius-xl    : 28px;

    --wpin-shadow-card  : 0 20px 60px rgba(37, 99, 235, .10), 0 4px 20px rgba(0, 0, 0, .06);
    --wpin-shadow-btn   : 0 4px 18px rgba(37, 99, 235, .30);
    --wpin-shadow-logo  : 0 8px 28px rgba(37, 99, 235, .30);
}

/* ── Fondo del formulario ───────────────────────────────────── */
.wpin-wrap {
    display         : flex;
    justify-content : center;
    align-items     : center;
    min-height      : 80vh;
    padding         : 48px 20px;
    background      : linear-gradient(
        135deg,
        var(--wpin-bg-grad-a) 0%,
        var(--wpin-bg-grad-b) 55%,
        #eef2ff 100%
    );
}

/* ── Card principal ─────────────────────────────────────────── */
.wpin-card {
    background   : var(--wpin-card);
    border-radius: var(--wpin-radius-xl);
    box-shadow   : var(--wpin-shadow-card);
    padding      : 56px 52px 48px;
    width        : 100%;
    max-width    : 500px;
}

/* ── Header ─────────────────────────────────────────────────── */
.wpin-header { text-align: center; margin-bottom: 36px; }

.wpin-logo {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    width          : 80px;
    height         : 80px;
    border-radius  : 50%;
    background     : linear-gradient(135deg, var(--wpin-primary), #818cf8);
    box-shadow     : var(--wpin-shadow-logo);
    margin-bottom  : 20px;
}
.wpin-logo .dashicons {
    font-size: 38px;
    width    : 38px;
    height   : 38px;
    color    : #fff;
}

.wpin-avatar {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    width          : 88px;
    height         : 88px;
    border-radius  : 50%;
    background     : linear-gradient(135deg, #eff6ff, #dbeafe);
    border         : 3px solid #bfdbfe;
    box-shadow     : var(--wpin-shadow-logo);
    margin-bottom  : 20px;
}
.wpin-avatar .dashicons {
    font-size: 42px;
    width    : 42px;
    height   : 42px;
    color    : var(--wpin-primary);
}

.wpin-title {
    font-size    : 1.9rem;
    font-weight  : 800;
    color        : var(--wpin-text);
    margin       : 0 0 8px;
    letter-spacing: -.025em;
    line-height  : 1.15;
}
.wpin-sub {
    font-size: 1rem;
    color    : var(--wpin-muted);
    margin   : 0;
}

/* ── Campo de texto ─────────────────────────────────────────── */
.wpin-field { margin-bottom: 22px; }

.wpin-field label {
    display       : block;
    font-size     : .78rem;
    font-weight   : 700;
    color         : var(--wpin-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom : 8px;
}
.wpin-field label .dashicons {
    font-size    : 14px;
    width        : 14px;
    height       : 14px;
    margin-right : 5px;
    vertical-align: middle;
}

.wpin-field input[type="text"],
.wpin-field input[type="email"],
.wpin-field input[type="password"] {
    width        : 100%;
    border       : 2px solid var(--wpin-border);
    border-radius: var(--wpin-radius-md);
    padding      : 15px 18px;
    font-size    : 1rem;
    color        : var(--wpin-text);
    background   : var(--wpin-surface);
    transition   : border-color .2s, box-shadow .2s, background .2s;
    outline      : none;
}
.wpin-field input:focus {
    border-color: var(--wpin-primary);
    box-shadow  : 0 0 0 4px var(--wpin-primary-ring);
    background  : #fff;
}

/* ── Input con ojo ──────────────────────────────────────────── */
.wpin-pwd-input-wrap { position: relative; }
.wpin-pwd-input-wrap input { padding-right: 50px !important; }
.wpin-pwd-toggle {
    position  : absolute;
    right     : 12px;
    top       : 50%;
    transform : translateY(-50%);
    background: none;
    border    : none;
    cursor    : pointer;
    color     : var(--wpin-muted);
    padding   : 4px;
    line-height: 1;
    transition: color .2s;
}
.wpin-pwd-toggle:hover { color: var(--wpin-primary); }
.wpin-pwd-toggle .dashicons { font-size: 18px; width: 18px; height: 18px; }

/* ── Barra de fortaleza ─────────────────────────────────────── */
.wpin-strength-bar {
    height       : 5px;
    background   : var(--wpin-border);
    border-radius: 6px;
    margin-top   : 8px;
    overflow     : hidden;
}
.wpin-strength-fill {
    height       : 100%;
    width        : 0;
    border-radius: 6px;
    transition   : width .3s ease, background .3s;
}
.wpin-strength-fill.str-1 { width: 20%; background: #ef4444; }
.wpin-strength-fill.str-2 { width: 40%; background: #f97316; }
.wpin-strength-fill.str-3 { width: 60%; background: var(--wpin-warn); }
.wpin-strength-fill.str-4 { width: 80%; background: #22c55e; }
.wpin-strength-fill.str-5 { width:100%; background: var(--wpin-success); }
.wpin-strength-label {
    font-size : .75rem;
    color     : var(--wpin-muted);
    margin    : 5px 0 0;
    min-height: 16px;
}

/* ── Label PIN ──────────────────────────────────────────────── */
.wpin-dot-label {
    font-size     : .78rem;
    font-weight   : 700;
    color         : var(--wpin-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin        : 0 0 14px;
    text-align    : center;
}

/* ── Dots ───────────────────────────────────────────────────── */
.wpin-dots {
    display        : flex;
    justify-content: center;
    gap            : 22px;
    margin-bottom  : 28px;
}
.wpin-dot {
    width        : 22px;
    height       : 22px;
    border-radius: 50%;
    background   : var(--wpin-dot-empty);
    transition   : background .2s, transform .15s, box-shadow .2s;
    display      : block;
}
.wpin-dot.filled {
    background: var(--wpin-dot-fill);
    transform : scale(1.25);
    box-shadow: 0 0 0 5px var(--wpin-dot-ring);
}
.wpin-dots-sm .wpin-dot { width: 14px; height: 14px; }
.wpin-dots-sm .wpin-dot.filled { box-shadow: 0 0 0 4px var(--wpin-dot-ring); }

/* ── Teclado numérico ───────────────────────────────────────── */
.wpin-keypad {
    display              : grid;
    grid-template-columns: repeat(3, 1fr);
    gap                  : 12px;
    margin-bottom        : 28px;
}
.wpin-keypad-sm { gap: 9px; }

.wpin-key {
    display        : flex;
    align-items    : center;
    justify-content: center;
    height         : 68px;
    border-radius  : var(--wpin-radius-md);
    background     : #f1f5f9;
    font-size      : 1.55rem;
    font-weight    : 700;
    color          : var(--wpin-text);
    cursor         : pointer;
    user-select    : none;
    border         : 2px solid transparent;
    transition     : background .15s, border-color .15s, transform .1s, box-shadow .15s;
    letter-spacing : -.01em;
}
.wpin-key:hover:not(.wpin-key-empty) {
    background  : #dbeafe;
    border-color: #bfdbfe;
    box-shadow  : 0 2px 8px rgba(37, 99, 235, .10);
}
.wpin-key:active:not(.wpin-key-empty) { transform: scale(.94); }
.wpin-key-del { color: var(--wpin-muted); font-size: 1.2rem; }
.wpin-key-del:hover {
    background  : #fee2e2 !important;
    border-color: #fca5a5 !important;
    color       : var(--wpin-error) !important;
}
.wpin-key-del .dashicons { font-size: 22px; width: 22px; height: 22px; }
.wpin-key-empty {
    background  : transparent !important;
    border-color: transparent !important;
    cursor      : default;
}
.wpin-keypad-sm .wpin-key { height: 54px; font-size: 1.25rem; border-radius: var(--wpin-radius-sm); }

/* ── Botón submit ───────────────────────────────────────────── */
.wpin-submit {
    width          : 100%;
    padding        : 17px;
    background     : linear-gradient(135deg, var(--wpin-primary), #3b82f6);
    color          : #fff;
    border         : none;
    border-radius  : var(--wpin-radius-md);
    font-size      : 1.05rem;
    font-weight    : 700;
    cursor         : pointer;
    letter-spacing : .01em;
    box-shadow     : var(--wpin-shadow-btn);
    transition     : opacity .2s, transform .15s, box-shadow .2s;
    display        : flex;
    align-items    : center;
    justify-content: center;
    gap            : 8px;
}
.wpin-submit:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(37, 99, 235, .38);
    transform : translateY(-1px);
}
.wpin-submit:active:not(:disabled) { transform: scale(.98); }
.wpin-submit:disabled { opacity: .45; cursor: default; box-shadow: none; }
.wpin-submit .dashicons { font-size: 20px; width: 20px; height: 20px; }

/* ── Footer ─────────────────────────────────────────────────── */
.wpin-footer {
    text-align: center;
    margin-top: 22px;
    font-size : .85rem;
    color     : #94a3b8;
}
.wpin-footer a { color: var(--wpin-primary); text-decoration: none; font-weight: 600; }
.wpin-footer a:hover { text-decoration: underline; }

/* ── Mensajes ───────────────────────────────────────────────── */
.wpin-msg {
    padding      : 12px 16px;
    border-radius: var(--wpin-radius-sm);
    font-size    : .9rem;
    margin-bottom: 20px;
    line-height  : 1.5;
}
.wpin-ok  { background: var(--wpin-success-bg); color: #065f46; border: 1px solid var(--wpin-success-brd); }
.wpin-err { background: var(--wpin-error-bg);   color: #991b1b; border: 1px solid var(--wpin-error-brd); }

/* ── Ya logueado ────────────────────────────────────────────── */
.wpin-already-in {
    display      : flex;
    align-items  : center;
    gap          : 12px;
    flex-wrap    : wrap;
    padding      : 22px 26px;
    background   : var(--wpin-success-bg);
    border       : 1px solid var(--wpin-success-brd);
    border-radius: var(--wpin-radius-lg);
    color        : #065f46;
    font-size    : .95rem;
}
.wpin-already-in .dashicons { font-size: 24px; width: 24px; color: var(--wpin-success); flex-shrink: 0; }
.wpin-btn-link {
    margin-left    : auto;
    background     : var(--wpin-success);
    color          : #fff !important;
    padding        : 10px 20px;
    border-radius  : var(--wpin-radius-sm);
    text-decoration: none !important;
    font-weight    : 700;
    font-size      : .88rem;
    transition     : background .2s;
}
.wpin-btn-link:hover { background: #047857; }

/* ── Wrapper centrado para widgets standalone ────────────────── */
.wpin-widget-wrap {
    display         : flex;
    justify-content : center;
    align-items     : flex-start;
    padding         : 40px 20px 60px;
    min-height      : 60vh;
    background      : linear-gradient(
        135deg,
        var(--wpin-bg-grad-a) 0%,
        var(--wpin-bg-grad-b) 55%,
        #eef2ff 100%
    );
}

/* ── Widget (cambio de PIN / contraseña) ────────────────────── */
.wpin-widget,
.wpin-password-widget {
    background   : var(--wpin-card);
    border       : 1.5px solid var(--wpin-border);
    border-radius: var(--wpin-radius-xl);
    padding      : 52px 48px 44px;
    width        : 100%;
    max-width    : 520px;
    box-shadow   : var(--wpin-shadow-card);
}

.wpin-widget-hdr {
    display      : flex;
    align-items  : flex-start;
    gap          : 18px;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1.5px solid var(--wpin-border);
}
.wpin-widget-hdr > .dashicons {
    font-size  : 38px;
    width      : 38px;
    height     : 38px;
    color      : var(--wpin-primary);
    flex-shrink: 0;
    margin-top : 3px;
}
.wpin-widget-hdr h4 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 800; color: var(--wpin-text); letter-spacing: -.02em; }
.wpin-widget-hdr p  { margin: 0; font-size: .95rem; color: var(--wpin-muted); }

.wpin-must-change {
    border-color: var(--wpin-warn);
    box-shadow  : 0 0 0 4px rgba(217, 119, 6, .08);
}
.wpin-alert {
    display      : flex;
    align-items  : flex-start;
    gap          : 12px;
    background   : var(--wpin-warn-bg);
    border       : 1px solid var(--wpin-warn-brd);
    border-radius: var(--wpin-radius-sm);
    padding      : 14px 16px;
    margin-bottom: 24px;
    color        : #78350f;
    font-size    : .9rem;
    line-height  : 1.5;
}
.wpin-alert .dashicons { color: var(--wpin-warn); font-size: 20px; width: 20px; flex-shrink: 0; margin-top: 1px; }

.wpin-chg-field {
    margin-bottom: 12px;
    padding      : 14px 18px;
    border-radius: var(--wpin-radius-sm);
    border       : 2px solid var(--wpin-border);
    background   : #f8fafc;
    transition   : border-color .2s, background .2s;
}
.wpin-chg-field.active {
    border-color: var(--wpin-primary);
    background  : #eff6ff;
}
.wpin-chg-field label {
    font-size     : .75rem;
    font-weight   : 700;
    color         : var(--wpin-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    display       : block;
    margin-bottom : 10px;
}
.wpin-chg-field.active label { color: var(--wpin-primary); }

/* ── Divisor ────────────────────────────────────────────────── */
.wpin-divider {
    display       : flex;
    align-items   : center;
    gap           : 14px;
    margin        : 36px 0 28px;
    color         : var(--wpin-muted);
    font-size     : .78rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight   : 700;
    white-space   : nowrap;
}
.wpin-divider::before,
.wpin-divider::after {
    content   : '';
    flex      : 1;
    height    : 1.5px;
    background: var(--wpin-border);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 580px) {
    .wpin-card { padding: 36px 24px 30px; border-radius: var(--wpin-radius-lg); }
    .wpin-title { font-size: 1.55rem; }
    .wpin-key   { height: 58px; font-size: 1.35rem; }
    .wpin-submit { padding: 15px; }
    .wpin-widget, .wpin-password-widget { padding: 32px 20px 28px; border-radius: var(--wpin-radius-lg); }
    .wpin-widget-wrap { padding: 24px 16px 40px; }
}
@media (max-width: 380px) {
    .wpin-card  { padding: 28px 16px 24px; }
    .wpin-title { font-size: 1.35rem; }
    .wpin-key   { height: 52px; font-size: 1.2rem; border-radius: var(--wpin-radius-sm); }
    .wpin-keypad { gap: 9px; }
}