/* =========================================================
   RRHH Martec - Pantalla de acceso
   Replica el diseno del sistema de referencia (tarjeta de
   cristal sobre fondo oscuro) con la identidad cromatica de
   Martec: verde esmeralda sobre carbon.
   ========================================================= */

:root {
    --bg-base: #060f0d;
    --brand: #34c99b;
    --brand-strong: #1fae85;
    --brand-soft: #7be3c4;
    --glass-top: rgba(22, 56, 48, 0.46);
    --glass-bottom: rgba(8, 24, 21, 0.58);
    --glass-border: rgba(96, 190, 160, 0.30);
    --text-main: #e9f7f2;
    --text-soft: rgba(214, 236, 228, 0.82);
    --input-bg: rgba(96, 148, 130, 0.14);
    --input-border: rgba(120, 178, 158, 0.26);
    --plate-bg: rgba(255, 255, 255, 0.97);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    position: relative;
    overflow: hidden;
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background-image: url("../img/fondo-login.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: saturate(0.95);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(140deg, rgba(4, 14, 12, 0.72) 0%, rgba(6, 24, 20, 0.68) 45%, rgba(10, 60, 48, 0.55) 100%),
        radial-gradient(1200px 700px at 14% 12%, rgba(52, 201, 155, 0.10), transparent 70%),
        radial-gradient(1000px 620px at 83% 86%, rgba(31, 174, 133, 0.10), transparent 68%);
}

/* ---------- Tarjeta principal ---------- */

.login-card {
    width: min(92vw, 420px);
    border-radius: 18px;
    padding: 24px 16px 16px;
    background: linear-gradient(165deg, var(--glass-top), var(--glass-bottom));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(230, 255, 248, 0.08);
}

.login-head {
    text-align: center;
    margin-bottom: 12px;
}

.brand-plate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(208px, 66vw);
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--plate-bg);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.brand-logo {
    width: 100%;
    height: auto;
    display: block;
}

.login-subtitle {
    margin: 10px 0 0;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 10px rgba(2, 12, 10, 0.55);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(52, 201, 155, 0.35);
    background: rgba(52, 201, 155, 0.12);
    color: var(--brand-soft);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- Panel del formulario ---------- */

.login-panel {
    border-radius: 14px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(20, 52, 45, 0.66), rgba(8, 22, 19, 0.74)),
        rgba(8, 22, 19, 0.68);
    border: 1px solid rgba(112, 184, 160, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(197, 255, 236, 0.07),
        0 14px 26px rgba(2, 9, 8, 0.32);
}

.alert {
    border-radius: 9px;
    margin-bottom: 10px;
    font-size: 0.86rem;
    border: 1px solid rgba(255, 122, 132, 0.4);
    background: rgba(129, 29, 40, 0.4);
    color: #ffe1e4;
    padding: 8px 10px;
    text-align: center;
    transition: opacity 0.4s ease;
}

.alert.fade {
    opacity: 0;
}

/* ---------- Campos ---------- */

.field-shell {
    margin-bottom: 8px;
}

.field-group {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(112, 168, 148, 0.3);
    background: linear-gradient(90deg, rgba(96, 148, 130, 0.26), rgba(108, 156, 138, 0.2));
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field-group:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(52, 201, 155, 0.24);
}

.field-group-password {
    background: linear-gradient(90deg, rgba(18, 84, 68, 0.48), rgba(88, 116, 108, 0.28));
}

.field-icon {
    border: none;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(48, 92, 80, 0.48);
    color: #c8f0e2;
}

.field-icon-pass {
    background: rgba(16, 74, 60, 0.72);
    color: #f0ca75;
}

.field-icon svg,
.password-toggle-btn svg,
.meta-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: none;
    background: transparent;
    color: #f1fffa;
    font-size: 0.98rem;
    padding: 9px 12px;
    font-family: inherit;
}

.field-input::placeholder {
    color: rgba(216, 240, 232, 0.7);
}

.field-input:focus {
    outline: none;
    background: rgba(140, 194, 176, 0.08);
    color: #ffffff;
}

.password-toggle-btn {
    border: none;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(150, 178, 170, 0.55);
    color: #eefbf7;
    cursor: pointer;
    transition: background 0.15s ease;
}

.password-toggle-btn:hover {
    background: rgba(176, 204, 196, 0.7);
    color: #ffffff;
}

.password-toggle-btn svg {
    width: 13px;
    height: 13px;
}

/* ---------- Boton principal ---------- */

.btn-login {
    margin-top: 6px;
    width: 100%;
    border: 1px solid rgba(122, 235, 199, 0.55);
    border-radius: 5px;
    padding: 10px 14px;
    color: #04241b;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    background: linear-gradient(97deg, #24b98c, #34c99b, #52d9ae);
    box-shadow: 0 8px 18px rgba(20, 140, 106, 0.32);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(20, 140, 106, 0.4);
    filter: brightness(1.04);
}

.btn-login:active {
    transform: translateY(0);
}

/* ---------- Enlaces de apoyo ---------- */

.forgot-password-wrap {
    margin-top: 10px;
    text-align: center;
}

.forgot-password-link {
    color: #cbe6dc;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.forgot-password-link:hover {
    color: var(--brand-soft);
}

.forgot-help {
    display: none;
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 9px;
    border: 1px solid rgba(140, 194, 176, 0.24);
    background: rgba(140, 194, 176, 0.12);
    color: #d5eeea;
    font-size: 0.82rem;
    text-align: center;
}

.forgot-help.show {
    display: block;
}

/* ---------- Notas de seguridad ---------- */

.login-meta {
    margin-top: 14px;
    display: grid;
    gap: 7px;
}

.login-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.79rem;
    line-height: 1.3;
    color: var(--text-soft);
}

.meta-icon {
    width: 14px;
    min-width: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b6dbcf;
}

.meta-icon-shield {
    color: #f0b9a0;
    filter: drop-shadow(0 0 4px rgba(240, 185, 160, 0.3));
}

.meta-icon-check {
    color: var(--brand-soft);
    filter: drop-shadow(0 0 4px rgba(123, 227, 196, 0.35));
}

.login-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(140, 190, 172, 0.2);
    font-size: 0.79rem;
    color: rgba(196, 220, 212, 0.8);
    text-align: center;
}

.login-footer strong {
    color: var(--brand-soft);
    font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    body {
        padding: 14px;
        align-items: flex-start;
    }

    .login-card {
        width: 100%;
        padding: 18px 14px 14px;
        margin: auto;
    }

    .login-subtitle {
        font-size: 1rem;
    }

    .brand-plate {
        width: min(180px, 70vw);
        padding: 8px 12px;
    }
}

@media (max-height: 700px) {
    .login-meta {
        display: none;
    }
}
/* =========================================================
   Utilidades compartidas por las pantallas publicas
   (acceso y cambio de clave).
   ========================================================= */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: 0.01em;
}

.form-error {
    display: block;
    margin-top: 4px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #ffb4ac;
}

.rule-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(214, 236, 228, 0.72);
}

.rule-item.is-ok {
    color: var(--brand-soft);
    font-weight: 650;
}

.rule-mark {
    width: 15px;
    min-width: 15px;
    text-align: center;
    font-weight: 700;
}

.input-group {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.input-group .form-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid rgba(112, 168, 148, 0.34);
    border-radius: 8px;
    background: rgba(96, 148, 130, 0.16);
    color: #f1fffa;
    font-family: inherit;
    font-size: 0.92rem;
}

.input-group .form-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(52, 201, 155, 0.24);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border-color: rgba(140, 194, 176, 0.42);
    color: #d8ece6;
}

.btn-outline:hover {
    border-color: var(--brand);
    color: var(--brand-soft);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 11px;
    font-size: 0.8rem;
    border-radius: 8px;
}
