/* =====================================================================
   LOGIN DE PROVEEDORES (login) — Brand guide v2.1
   Uses provider-landing.css (header, hero, card, inputs, buttons,
   popups, footer) and adds only what this page needs.
   Scoped to body.login-v2 → no other page changes.
   ===================================================================== */

html.i18n-wait body { visibility: hidden; }

body.login-v2 {
    height: auto;
    min-height: 100vh;
}

body.login-v2 .reg-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    grid-template-areas: "hero card" "other card";
    align-items: start;
    row-gap: 24px;
}
body.login-v2 .reg-hero   { grid-area: hero; }
body.login-v2 .login-box  { grid-area: card; align-self: center; }
body.login-v2 .login-other { grid-area: other; align-self: start; }

/* Hero */
body.login-v2 .login-pill {
    color: #043259;
}
body.login-v2 .login-pill-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
body.login-v2 .login-header1 {
    max-width: none;
    margin: 0;
    text-align: left;
}
body.login-v2 .login-header2 {
    max-width: 520px;
    margin: 0;
    text-align: left;
}

/* "¿No es proveedor de salud?" */
body.login-v2 .login-other {
    max-width: 520px;
    padding: 16px 18px;
    border: 1px dashed #60A699;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
}
body.login-v2 .login-other-title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .login-other-text {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #4D6F8C;
}
body.login-v2 .login-other-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}
body.login-v2 .login-other-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #036A6F;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
body.login-v2 .login-other-link:hover {
    text-decoration: underline;
}

/* Card */
body.login-v2 .login-box {
    position: static;
    width: 100%;
    margin: 0;
}
body.login-v2 .login-card-eyebrow {
    margin: 0 0 2px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #036A6F !important;
}
body.login-v2 .login-box form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: none;
    margin: 0;
}
body.login-v2 .login-field label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .login-field input {
    width: 100%;
    margin: 0;
}
body.login-v2 .password-input-container {
    position: relative;
    max-width: none;
}
body.login-v2 .password-input-container input {
    padding-right: 52px !important;
}
body.login-v2 .toggle-password-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: none;
    transform: translateY(-50%);
    cursor: pointer;
}
body.login-v2 .toggle-password-btn:hover {
    background: rgba(176, 217, 205, 0.35);
}
body.login-v2 .login-field .field-error-text {
    margin: 6px 0 0;
}

body.login-v2 .form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0;
    max-width: none;
}
body.login-v2 .checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #043259;
    cursor: pointer;
}
body.login-v2 .checkbox-container input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #036A6F;
}
body.login-v2 #forgot-password-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #036A6F;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
body.login-v2 #forgot-password-link:hover {
    text-decoration: underline;
}
body.login-v2 .registration-links {
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(176, 217, 205, 0.6);
    font-size: 14px;
    text-align: center;
    color: #4D6F8C;
}
body.login-v2 .registration-links a {
    color: #036A6F;
    font-weight: 700;
    text-decoration: none;
}
body.login-v2 .registration-links a:hover {
    text-decoration: underline;
}

/* Forgot-password modal (same ids/classes as before) */
body.login-v2 .modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 50, 89, 0.55);
}
body.login-v2 .modal-overlay.active {
    display: flex;
}
body.login-v2 .modal-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 24px 24px;
    border-radius: 10px;
    border-top: 3px solid #036A6F;
    background: #FFFFFF;
    box-shadow: 0 10px 40px rgba(4, 50, 89, 0.24);
    color: #043259;
}
body.login-v2 .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 5px;
    background: none;
    color: #4D6F8C;
    font-size: 16px;
    cursor: pointer;
}
body.login-v2 .modal-close:hover {
    background: rgba(176, 217, 205, 0.35);
    color: #043259;
}
body.login-v2 .modal-header {
    margin-bottom: 20px;
    text-align: left;
}
body.login-v2 .modal-header h2 {
    margin: 0 40px 6px 0;
    font-size: 20px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .modal-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4D6F8C;
}
body.login-v2 .modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 0 12px;
    border-radius: 10px;
    background: rgba(176, 217, 205, 0.35);
}
body.login-v2 .modal-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
body.login-v2 .modal-form-group {
    margin-bottom: 16px;
}
body.login-v2 .modal-label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .modal-input {
    display: block;
    width: 100%;
}
body.login-v2 .modal-form-group .field-error-text {
    display: block;
    margin: 6px 0 0;
}
body.login-v2 .modal-form-group .field-error-text:empty {
    display: none;
}
body.login-v2 .modal-server-error {
    display: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 5px;
    background: rgba(184, 58, 61, 0.08);
    color: #B83A3D;
    font-size: 14px;
    font-weight: 600;
}
body.login-v2 .modal-info-box {
    padding: 12px 14px;
    border-radius: 6px;
    background: rgba(176, 217, 205, 0.2);
    font-size: 14px;
    line-height: 1.5;
    color: #043259;
}
body.login-v2 .modal-info-box p {
    margin: 0;
}
body.login-v2 .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}
body.login-v2 .btn-primary,
body.login-v2 .btn-secondary {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 5px;
    font: 700 15px "Nunito Sans", system-ui, sans-serif;
    cursor: pointer;
    transition: background .15s ease;
}
body.login-v2 .btn-primary {
    border: none;
    background: #043259;
    color: #FFFFFF;
}
body.login-v2 .btn-primary:hover:not(:disabled) {
    background: #036A6F;
}
body.login-v2 .btn-secondary {
    border: 1px solid #60A699;
    background: #FFFFFF;
    color: #043259;
}
body.login-v2 .btn-secondary:hover:not(:disabled) {
    background: rgba(176, 217, 205, 0.25);
}
body.login-v2 .btn-primary:disabled,
body.login-v2 .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
body.login-v2 .resend-timer {
    display: none;
    margin-top: 12px;
    font-size: 13px;
    text-align: right;
    color: #4D6F8C;
}

/* =====================================================================
   LOGIN · RESTABLECER CONTRASEÑA · INVITACIÓN DE DELEGADO
   Paste this block at the END of provider-landing.css.
   Reuses the registro rules (header, card, inputs, buttons, popups,
   footer). Scoped to body.login-v2 / .reset-v2 / .invite-v2, so
   registro and the other pages don't change.
   ===================================================================== */

body.login-v2 {
    height: auto;
    min-height: 100vh;
}

body.login-v2 .reg-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    grid-template-areas: "hero card" "other card";
    align-items: start;
    row-gap: 24px;
}
body.login-v2 .reg-hero   { grid-area: hero; }
body.login-v2 .login-box  { grid-area: card; align-self: center; }
body.login-v2 .login-other { grid-area: other; align-self: start; }

/* Hero */
body.login-v2 .login-pill {
    color: #043259;
}
body.login-v2 .login-pill-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
body.login-v2 .login-header1 {
    max-width: none;
    margin: 0;
    text-align: left;
}
body.login-v2 .login-header2 {
    max-width: 520px;
    margin: 0;
    text-align: left;
}

/* "¿No es proveedor de salud?" */
body.login-v2 .login-other {
    max-width: 520px;
    padding: 16px 18px;
    border: 1px dashed #60A699;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
}
body.login-v2 .login-other-title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .login-other-text {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #4D6F8C;
}
body.login-v2 .login-other-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}
body.login-v2 .login-other-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #036A6F;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
body.login-v2 .login-other-link:hover {
    text-decoration: underline;
}

/* Card */
body.login-v2 .login-box {
    position: static;
    width: 100%;
    margin: 0;
}
body.login-v2 .login-card-eyebrow {
    margin: 0 0 2px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #036A6F !important;
}
body.login-v2 .login-box form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: none;
    margin: 0;
}
body.login-v2 .login-field label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .login-field input {
    width: 100%;
    margin: 0;
}
body.login-v2 .password-input-container {
    position: relative;
    max-width: none;
}
body.login-v2 .password-input-container input {
    padding-right: 52px !important;
}
body.login-v2 .toggle-password-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: none;
    transform: translateY(-50%);
    cursor: pointer;
}
body.login-v2 .toggle-password-btn:hover {
    background: rgba(176, 217, 205, 0.35);
}
body.login-v2 .login-field .field-error-text {
    margin: 6px 0 0;
}

body.login-v2 .form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0;
    max-width: none;
}
body.login-v2 .checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #043259;
    cursor: pointer;
}
body.login-v2 .checkbox-container input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #036A6F;
}
body.login-v2 #forgot-password-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #036A6F;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
body.login-v2 #forgot-password-link:hover {
    text-decoration: underline;
}
body.login-v2 .registration-links {
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(176, 217, 205, 0.6);
    font-size: 14px;
    text-align: center;
    color: #4D6F8C;
}
body.login-v2 .registration-links a {
    color: #036A6F;
    font-weight: 700;
    text-decoration: none;
}
body.login-v2 .registration-links a:hover {
    text-decoration: underline;
}

/* Forgot-password modal (same ids/classes as before) */
body.login-v2 .modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 50, 89, 0.55);
}
body.login-v2 .modal-overlay.active {
    display: flex;
}
body.login-v2 .modal-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 24px 24px;
    border-radius: 10px;
    border-top: 3px solid #036A6F;
    background: #FFFFFF;
    box-shadow: 0 10px 40px rgba(4, 50, 89, 0.24);
    color: #043259;
}
body.login-v2 .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 5px;
    background: none;
    color: #4D6F8C;
    font-size: 16px;
    cursor: pointer;
}
body.login-v2 .modal-close:hover {
    background: rgba(176, 217, 205, 0.35);
    color: #043259;
}
body.login-v2 .modal-header {
    margin-bottom: 20px;
    text-align: left;
}
body.login-v2 .modal-header h2 {
    margin: 0 40px 6px 0;
    font-size: 20px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .modal-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4D6F8C;
}
body.login-v2 .modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 0 12px;
    border-radius: 10px;
    background: rgba(176, 217, 205, 0.35);
}
body.login-v2 .modal-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
body.login-v2 .modal-form-group {
    margin-bottom: 16px;
}
body.login-v2 .modal-label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #043259;
}
body.login-v2 .modal-input {
    display: block;
    width: 100%;
}
body.login-v2 .modal-form-group .field-error-text {
    display: block;
    margin: 6px 0 0;
}
body.login-v2 .modal-form-group .field-error-text:empty {
    display: none;
}
body.login-v2 .modal-server-error {
    display: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 5px;
    background: rgba(184, 58, 61, 0.08);
    color: #B83A3D;
    font-size: 14px;
    font-weight: 600;
}
body.login-v2 .modal-info-box {
    padding: 12px 14px;
    border-radius: 6px;
    background: rgba(176, 217, 205, 0.2);
    font-size: 14px;
    line-height: 1.5;
    color: #043259;
}
body.login-v2 .modal-info-box p {
    margin: 0;
}
body.login-v2 .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}
body.login-v2 .btn-primary,
body.login-v2 .btn-secondary {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 5px;
    font: 700 15px "Nunito Sans", system-ui, sans-serif;
    cursor: pointer;
    transition: background .15s ease;
}
body.login-v2 .btn-primary {
    border: none;
    background: #043259;
    color: #FFFFFF;
}
body.login-v2 .btn-primary:hover:not(:disabled) {
    background: #036A6F;
}
body.login-v2 .btn-secondary {
    border: 1px solid #60A699;
    background: #FFFFFF;
    color: #043259;
}
body.login-v2 .btn-secondary:hover:not(:disabled) {
    background: rgba(176, 217, 205, 0.25);
}
body.login-v2 .btn-primary:disabled,
body.login-v2 .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
body.login-v2 .resend-timer {
    display: none;
    margin-top: 12px;
    font-size: 13px;
    text-align: right;
    color: #4D6F8C;
}

@media (max-width: 900px) {
    body.login-v2 .reg-top {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "hero" "card" "other";
    }
    body.login-v2 .login-benefits {
        display: none;          /* keep the phone screen short */
    }
}
@media (max-width: 600px) {
    body.login-v2 .modal-actions {
        flex-direction: column-reverse;
    }
    body.login-v2 .modal-actions button {
        width: 100%;
    }
    body.login-v2 .resend-timer {
        text-align: center;
    }
}

/* =====================================================================
   RESTABLECER CONTRASEÑA (reset page) — body.reset-v2
   forgot_password.js shows the states with style.display or .show,
   so both work here.
   ===================================================================== */
body.reset-v2 main {
    display: flex;
    flex-direction: column;
}
body.reset-v2 .reset-wrap {
    position: relative;
    display: flex;
    flex: 1 0 auto;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 16px 64px;
}
body.reset-v2 .reset-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(245, 249, 249, 0) 35%, #F5F9F9 100%) top / 100% 420px no-repeat,
        linear-gradient(180deg, rgba(176, 217, 205, 0.38) 0%, rgba(245, 249, 249, 0) 100%) top / 100% 420px no-repeat,
        repeating-linear-gradient(0deg, rgba(3, 106, 111, 0.07) 0 1px, transparent 1px 32px) top / 100% 420px no-repeat,
        repeating-linear-gradient(90deg, rgba(3, 106, 111, 0.07) 0 1px, transparent 1px 32px) top / 100% 420px no-repeat;
}
body.reset-v2 .login-box,
body.reset-v2 .reset-state {
    width: 100%;
    max-width: 460px;
}
body.reset-v2 .reset-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    color: #043259;
}
body.reset-v2 .login-box form {
    gap: 0;
}

/* Password requirements (forgot_password.js adds .valid) */
body.reset-v2 .password-requirements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 5px;
    background: rgba(176, 217, 205, 0.15);
}
body.reset-v2 .password-requirements p {
    margin: 0;
    font-size: 13px;
    color: #4D6F8C;
}
body.reset-v2 .password-requirements p::before {
    content: "○ ";
}
body.reset-v2 .password-requirements p.valid {
    color: #036A6F;
    font-weight: 600;
}
body.reset-v2 .password-requirements p.valid::before {
    content: "✓ ";
}
body.reset-v2 a.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Expired link / success cards */
body.reset-v2 .reset-state {
    display: none;
    padding: 32px 28px 28px;
    text-align: center;
}
body.reset-v2 .reset-state.show {
    display: block;
}
body.reset-v2 .reset-state .popup-message {
    gap: 0;
}
body.reset-v2 .reset-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 10px;
}
body.reset-v2 .reset-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.reset-v2 .reset-icon--ok   { background: rgba(176, 217, 205, 0.45); }
body.reset-v2 .reset-icon--ok svg { stroke: #036A6F; }
body.reset-v2 .reset-icon--warn { background: rgba(240, 192, 110, 0.3); }
body.reset-v2 .reset-icon--warn svg { stroke: #A34E0C; }
body.reset-v2 .reset-state-title {
    display: block;
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    color: #043259;
}
body.reset-v2 .reset-state-subtitle,
body.reset-v2 .reset-state .popup-message .reset-state-subtitle {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.55;
    color: #4D6F8C;
}
body.reset-v2 .reset-back-btn {
    text-decoration: none;
}

@media (max-width: 600px) {
    body.reset-v2 .reset-wrap {
        padding-top: 24px;
    }
    body.reset-v2 .password-requirements {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =====================================================================
   INVITACIÓN DE DELEGADO — body.invite-v2 (uses the reset layout)
   ===================================================================== */
body.invite-v2 .invite-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 28px;
    text-align: center;
    color: #4D6F8C;
    font-size: 15px;
}
body.invite-v2 .invite-loader {
    width: 24px;
    height: 24px;
    border: 3px solid #036A6F;
    border-top-color: transparent;
    border-radius: 5px;
    animation: invite-spin 0.9s linear infinite;
}
@keyframes invite-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    body.invite-v2 .invite-loader { animation: none; }
}
body.invite-v2 .invite-info {
    margin: 12px 0 20px;
    padding: 14px 16px;
    border-radius: 6px;
    border: 1px solid rgba(176, 217, 205, 0.9);
    background: rgba(176, 217, 205, 0.18);
}
body.invite-v2 .invite-info-label {
    margin: 0 0 2px;
    font-size: 13px;
    color: #4D6F8C;
}
body.invite-v2 .invite-provider {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #043259;
}
body.invite-v2 .invite-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-top: 8px;
    font-size: 13px;
    color: #4D6F8C;
}
body.invite-v2 .invite-role {
    padding: 2px 8px;
    border-radius: 5px;
    background: #036A6F;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 900px) {
    body.login-v2 .reg-top {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "hero" "card" "other";
    }
    body.login-v2 .login-benefits {
        display: none;          /* keep the phone screen short */
    }
}
@media (max-width: 600px) {
    body.login-v2 .modal-actions {
        flex-direction: column-reverse;
    }
    body.login-v2 .modal-actions button {
        width: 100%;
    }
    body.login-v2 .resend-timer {
        text-align: center;
    }
}