/*=============================================
=        RECUPERAR CLAVE - CSS               =
=============================================*/

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
    --rc-red:        #E63946;
    --rc-blue:       #1D3557;
    --rc-blue-dark:  #0f1f3d;
    --rc-bg:         #f5f6fa;
    --rc-white:      #ffffff;
    --rc-border:     #e4e6ef;
    --rc-text:       #1a1a2e;
    --rc-muted:      #6b7280;
    --rc-success:    #10b981;
    --rc-warning:    #f59e0b;
    --rc-radius:     16px;
    --rc-shadow:     0 8px 40px rgba(29,53,87,.12);
    --rc-transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ---- Sección raíz ---- */
.recover-section {
    min-height: 100vh;
    background: var(--rc-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    font-family: 'DM Sans', sans-serif;
    /* Patrón de fondo sutil */
    background-image:
        radial-gradient(circle at 20% 20%, rgba(230,57,70,.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(29,53,87,.07) 0%, transparent 50%);
}

.recover-wrap {
    width: 100%;
    max-width: 440px;
}

/* ---- Card ---- */
.recover-card {
    background: var(--rc-white);
    border-radius: var(--rc-radius);
    border: 1px solid var(--rc-border);
    box-shadow: var(--rc-shadow);
    padding: 40px 36px 36px;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: cardIn .3s ease;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Icono marca ---- */
.recover-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.recover-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--rc-red) 0%, #c1121f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 6px 20px rgba(230,57,70,.35);
}

.recover-icon-code {
    background: linear-gradient(135deg, #1D3557 0%, #0f1f3d 100%);
    box-shadow: 0 6px 20px rgba(29,53,87,.3);
}

.recover-icon-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16,185,129,.3);
}

/* ---- Títulos ---- */
.recover-head {
    text-align: center;
    margin-bottom: 28px;
}

.recover-titulo {
    font-family: 'Syne', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--rc-text);
    margin: 0 0 8px;
}

.recover-subtitulo {
    font-size: .83rem;
    color: var(--rc-muted);
    margin: 0;
    line-height: 1.55;
}

.recover-subtitulo strong {
    color: var(--rc-text);
    font-weight: 600;
}

/* ---- Form group ---- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--rc-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
}

/* Input con icono prefijo */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix-icon {
    position: absolute;
    left: 14px;
    color: var(--rc-muted);
    font-size: .85rem;
    pointer-events: none;
}

.input-icon-wrap input {
    width: 100%;
    padding: 11px 14px 11px 38px;
    border: 1.5px solid var(--rc-border);
    border-radius: 9px;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    color: var(--rc-text);
    background: #fafbfc;
    transition: border-color var(--rc-transition), box-shadow var(--rc-transition), background var(--rc-transition);
    outline: none;
}

.input-icon-wrap input:focus {
    border-color: var(--rc-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230,57,70,.10);
}

/* Input contraseña */
.input-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrap input {
    width: 100%;
    padding: 11px 44px 11px 14px;
    border: 1.5px solid var(--rc-border);
    border-radius: 9px;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    color: var(--rc-text);
    background: #fafbfc;
    transition: border-color var(--rc-transition), box-shadow var(--rc-transition), background var(--rc-transition);
    outline: none;
}

.input-password-wrap input:focus {
    border-color: var(--rc-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230,57,70,.10);
}

.input-password-wrap input.input-error {
    border-color: var(--rc-red);
    background: #fff5f5;
}

.input-password-wrap input.input-ok {
    border-color: var(--rc-success);
    background: #f0fdf8;
}

.toggle-pass {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--rc-muted);
    font-size: .9rem;
    padding: 4px;
    transition: color var(--rc-transition);
    line-height: 1;
}

.toggle-pass:hover { color: var(--rc-red); }

/* ---- Barra fortaleza ---- */
.strength-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.strength-bar {
    flex: 1;
    height: 5px;
    background: var(--rc-border);
    border-radius: 99px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width .3s ease, background .3s ease;
}

.strength-label {
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

.strength-weak   .strength-fill { width: 25%;  background: var(--rc-red); }
.strength-fair   .strength-fill { width: 50%;  background: var(--rc-warning); }
.strength-good   .strength-fill { width: 75%;  background: #3b82f6; }
.strength-strong .strength-fill { width: 100%; background: var(--rc-success); }

.strength-weak   .strength-label { color: var(--rc-red); }
.strength-fair   .strength-label { color: var(--rc-warning); }
.strength-good   .strength-label { color: #3b82f6; }
.strength-strong .strength-label { color: var(--rc-success); }

/* ---- Match msg ---- */
.match-msg {
    font-size: .77rem;
    font-weight: 600;
    margin-top: 4px;
    min-height: 18px;
    display: block;
}
.match-ok    { color: var(--rc-success); }
.match-error { color: var(--rc-red); }

/* ---- Requisitos inline ---- */
.req-list-inline {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.req-list-inline li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 99px;
    background: #f3f4f6;
    color: var(--rc-muted);
    border: 1px solid var(--rc-border);
    transition: all var(--rc-transition);
}

.req-list-inline li i {
    font-size: .68rem;
    color: #d1d5db;
    transition: color var(--rc-transition);
}

.req-list-inline li.req-pass {
    background: #ecfdf5;
    color: var(--rc-success);
    border-color: #6ee7b7;
}

.req-list-inline li.req-pass i {
    color: var(--rc-success);
}

/* ---- Código digits ---- */
.codigo-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.codigo-digit {
    width: 52px;
    height: 60px;
    border: 2px solid var(--rc-border);
    border-radius: 12px;
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--rc-text);
    background: #fafbfc;
    outline: none;
    transition: border-color var(--rc-transition), box-shadow var(--rc-transition), background var(--rc-transition), transform var(--rc-transition);
    -moz-appearance: textfield;
}

.codigo-digit::-webkit-outer-spin-button,
.codigo-digit::-webkit-inner-spin-button { -webkit-appearance: none; }

.codigo-digit:focus {
    border-color: var(--rc-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230,57,70,.12);
    transform: translateY(-2px);
}

.codigo-digit.digit-filled {
    border-color: var(--rc-blue);
    background: #fff;
    color: var(--rc-blue);
}

.codigo-digit.digit-error {
    border-color: var(--rc-red);
    background: #fff5f5;
    animation: shake .3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-4px); }
    60%       { transform: translateX(4px); }
    80%       { transform: translateX(-3px); }
}

/* ---- Timer ---- */
.codigo-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: .78rem;
    color: var(--rc-muted);
    margin-bottom: 20px;
}

.codigo-timer i { color: var(--rc-red); }
.codigo-timer strong { color: var(--rc-text); font-variant-numeric: tabular-nums; }
.codigo-timer.expired strong { color: var(--rc-red); }

/* ---- Botones ---- */
.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--rc-red);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(230,57,70,.30);
    transition: all var(--rc-transition);
    margin-bottom: 12px;
}

.btn-primary:hover:not(:disabled) {
    background: #c1121f;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(230,57,70,.38);
}

.btn-primary:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary .fa-spinner {
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-link-back,
.btn-link-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--rc-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    padding: 4px;
    transition: color var(--rc-transition);
    width: 100%;
}

.btn-link-back:hover,
.btn-link-text:hover { color: var(--rc-red); }

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .recover-card { padding: 32px 20px 28px; }
    .codigo-digit { width: 44px; height: 52px; font-size: 1.2rem; border-radius: 10px; }
    .codigo-inputs { gap: 7px; }
}