/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * Reusable Heritage account access layout and scoped form presentation.
 */
.heritage-auth, .heritage-auth * { box-sizing: border-box; }
.heritage-auth { margin: 0; min-height: 100vh; background: var(--hd-bg); color: var(--hd-ink); font: 15px/1.6 var(--hd-sans); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
.heritage-auth a { color: var(--hd-primary); text-underline-offset: 3px; }
.heritage-auth a:hover { color: #395e49; }
.heritage-auth :is(a,button,input):focus-visible { outline: 3px solid var(--hd-gold); outline-offset: 3px; }
.heritage-auth [hidden] { display: none !important; }
.heritage-auth-shell { width: min(1120px, 100%); margin: 0 auto; padding: 24px 32px; }
.heritage-auth-brandbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.heritage-auth-logo { display: inline-flex; align-items: center; min-height: 44px; max-width: 60%; }
.heritage-auth-logo img { max-width: 100%; object-fit: contain; }
.heritage-auth-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .85rem; text-decoration: none; }
.heritage-auth-workspace { display: grid; grid-template-columns: minmax(240px, .78fr) minmax(0, 1.22fr); background: var(--hd-surface); border: 1px solid var(--hd-border); border-radius: 20px; overflow: clip; }
.heritage-auth-context { display: flex; flex-direction: column; gap: 22px; padding: 44px 36px; background: var(--hd-sand); border-right: 1px solid var(--hd-border); }
.heritage-auth-eyebrow { color: #816634; font-size: .67rem; font-weight: 700; letter-spacing: .14em; }
.heritage-auth-context-title { margin: 12px 0 0; font: 500 clamp(2.6rem, 4vw, 3.5rem)/1.06 var(--hd-serif); color: var(--hd-primary); letter-spacing: -.025em; }
.heritage-auth-context > p:not(.heritage-auth-context-title) { color: #58594f; margin: 0; max-width: 29ch; }
.heritage-auth-context-note { display: flex; align-items: flex-start; gap: 12px; margin-top: auto; padding-top: 36px; color: #525a4e; font-size: .83rem; }
.heritage-auth-context-note p { margin: 0; }
.heritage-auth-context-note .dna-icon { flex: 0 0 20px; margin-top: 4px; }
.heritage-auth-content { min-width: 0; padding: 38px 44px; }
.heritage-auth .auth-container, .heritage-auth .auth-form-section, .heritage-auth .auth-form-container { width: 100%; min-width: 0; }
.heritage-auth .auth-form-card { display: flex; flex-direction: column; gap: 20px; }
.heritage-auth .auth-form-header { margin: 0; }
.heritage-auth .auth-form-title { font: 500 clamp(2.25rem, 3.5vw, 2.9rem)/1.08 var(--hd-serif); color: var(--hd-primary); letter-spacing: -.02em; margin: 0 0 12px; }
.heritage-auth h2 { font: 500 1.65rem/1.2 var(--hd-serif); color: var(--hd-primary); }
.heritage-auth .auth-form-subtitle { color: var(--hd-muted); font-size: .9rem; margin: 0 0 10px; }
.heritage-auth .auth-form-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--hd-sage); color: var(--hd-primary); border-radius: 12px; margin-bottom: 16px; }
.heritage-auth .auth-form { display: flex; flex-direction: column; gap: 18px; }
.heritage-auth .auth-form-group { min-width: 0; margin: 0; }
.heritage-auth .auth-form-label { display: block; font-size: .83rem; font-weight: 600; color: var(--hd-ink); margin: 0 0 7px; }
.heritage-auth .auth-input-wrapper { position: relative; }
.heritage-auth .auth-form-control { display: block; width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #cecfc4; border-radius: 8px; background: white; color: var(--hd-ink); font: inherit; font-size: 1rem; box-shadow: none; }
.heritage-auth .auth-form-control::placeholder { color: #797b73; }
.heritage-auth .auth-form-control:focus { border-color: var(--hd-primary); }
.heritage-auth .auth-form-control[readonly] { background: var(--hd-bg); }
.heritage-auth .auth-input-wrapper:has(.auth-input-icon) .auth-form-control { padding-left: 42px; }
.heritage-auth .auth-input-wrapper:has(.password-toggle) .auth-form-control { padding-right: 50px; }
.heritage-auth .auth-input-icon { position: absolute; left: 14px; top: 16px; color: #70776b; pointer-events: none; }
.heritage-auth .password-toggle { display: none; position: absolute; right: 2px; top: 2px; width: 44px; min-height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--hd-primary); align-items: center; justify-content: center; cursor: pointer; }
.heritage-auth.auth-enhanced .password-toggle { display: inline-flex; }
.heritage-auth .password-toggle:hover { background: var(--hd-sage); }
.heritage-auth .dna-icon-eye-slash { -webkit-mask-image: url('/img/icons/reports/actions/eye.svg'); mask-image: url('/img/icons/reports/actions/eye.svg'); }
.heritage-auth .password-toggle[aria-pressed="true"]::after { content: ''; position: absolute; width: 23px; height: 2px; transform: rotate(-40deg); background: currentColor; border: 1px solid white; box-sizing: content-box; }
.heritage-auth .auth-checkbox-group { margin: 0; }
.heritage-auth .auth-checkboxes-section { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.heritage-auth .auth-checkbox-container { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin: 0; cursor: pointer; }
.heritage-auth .auth-checkbox-input, .heritage-auth input[type="checkbox"], .heritage-auth input[type="radio"] { accent-color: var(--hd-primary); width: 18px; height: 18px; flex: 0 0 18px; margin-top: 4px; }
.heritage-auth .auth-checkbox-custom { display: none; }
.heritage-auth .auth-checkbox-label { font-size: .85rem; line-height: 1.65; }
.heritage-auth .auth-checkbox-label-small { font-size: .79rem; }
.heritage-auth .auth-checkbox-label a { text-decoration: underline; }
.heritage-auth .required-indicator { color: #8e3428; }
.heritage-auth .auth-btn-primary, .heritage-auth .auth-btn-social { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 11px 16px; border: 1px solid var(--hd-primary); border-radius: 8px; background: var(--hd-primary); color: white; font: 600 .9rem/1.5 var(--hd-sans); white-space: normal; text-align: center; text-decoration: none; cursor: pointer; }
.heritage-auth .auth-btn-primary:hover { background: #304d3c; color: white; }
.heritage-auth .auth-btn-social { background: white; border-color: #d5d7cd; color: var(--hd-primary); }
.heritage-auth .auth-btn-social:hover { background: var(--hd-bg); }
.heritage-auth .auth-btn-primary:disabled, .heritage-auth .auth-btn-social:disabled { opacity: .6; cursor: default; }
.heritage-auth .auth-btn-primary .btn-text { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.heritage-auth .btn-loading { display: none; align-items: center; justify-content: center; gap: 10px; }
.heritage-auth .loading .btn-text { display: none; }
.heritage-auth .loading .btn-loading { display: inline-flex; }
.heritage-auth .btn-ripple { display: none; }
.heritage-auth .spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #ffffff66; border-top-color: white; border-radius: 50%; animation: heritage-auth-spin 1s linear infinite; }
@keyframes heritage-auth-spin { to { transform: rotate(360deg); } }
.heritage-auth .auth-divider { display: flex; gap: 12px; align-items: center; color: var(--hd-muted); font-size: .75rem; }
.heritage-auth .auth-divider::before, .heritage-auth .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--hd-border); }
.heritage-auth .auth-social-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.heritage-auth .social-form { flex: 1 1 140px; margin: 0; }
.heritage-auth .social-icon { width: 20px; height: 20px; flex-shrink: 0; }
.heritage-auth .auth-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .79rem; }
.heritage-auth .auth-footer-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }
.heritage-auth .auth-footer-separator { display: none; }
.heritage-auth .auth-footer-text { color: var(--hd-muted); }
.heritage-auth .auth-alert, .heritage-auth .auth-info-box { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; margin: 0; background: var(--hd-sage); border: 1px solid #d5dfd0; border-radius: 8px; color: var(--hd-primary); font-size: .83rem; }
.heritage-auth .auth-alert > .dna-icon, .heritage-auth .auth-info-box > .dna-icon { flex-shrink: 0; margin-top: 4px; }
.heritage-auth .auth-info-box p, .heritage-auth .auth-alert p { margin: 0; }
.heritage-auth .auth-info-box h4 { margin: 0 0 8px; font-size: .85rem; font-weight: 600; }
.heritage-auth .auth-info-box ul, .heritage-auth .auth-info-box ol { margin: 0; padding-left: 18px; }
.heritage-auth .auth-info-box:has(> h4) { display: block; }
.heritage-auth .alert-danger { color: #823d30; background: #fbf0eb; border-color: #e9d2c8; }
.heritage-auth .alert-success { color: var(--hd-primary); background: var(--hd-sage); border-color: #d5dfd0; }
.heritage-auth .auth-client-error { display: none; }
.heritage-auth .auth-alert ul { margin: 0; padding-left: 18px; }
.heritage-auth .auth-error-message, .heritage-auth .caps-lock-warning { display: none; align-items: center; gap: 6px; color: #8b3d2f; font-size: .77rem; margin-top: 6px; }
.heritage-auth .auth-error-message.show, .heritage-auth .caps-lock-warning.show, .heritage-auth .auth-error-message:has(.field-validation-error) { display: flex; }
.heritage-auth .text-danger, .heritage-auth .field-validation-error { color: #8b3d2f !important; font-size: .8rem; }
.heritage-auth .text-info { color: var(--hd-muted) !important; }
.heritage-auth .validation-icon-wrapper { display: none; position: absolute; right: 14px; top: 16px; color: #536d57; }
.heritage-auth .auth-input-wrapper:has(.password-toggle) .validation-icon-wrapper { display: none !important; }
.heritage-auth .validation-icon-wrapper.show { display: inline-flex; }
.heritage-auth .auth-form-control.is-invalid { border-color: #9e4937; }
.heritage-auth .auth-form-control.is-valid { border-color: #718b70; }
.heritage-auth .password-strength-container { display: none; margin-top: 9px; }
.heritage-auth .password-strength-container.show { display: block; }
.heritage-auth .password-strength-bar { height: 4px; background: var(--hd-border); border-radius: 3px; }
.heritage-auth .password-strength-fill { height: 100%; background: #667e61; border-radius: 3px; }
.heritage-auth .password-strength-fill.very-weak, .heritage-auth .password-strength-fill.weak { background: #9e4937; }
.heritage-auth .password-strength-fill.fair { background: #a48742; }
.heritage-auth .password-strength-text { color: var(--hd-muted); font-size: .72rem; }
.heritage-auth .auth-method-options { display: flex; flex-wrap: wrap; gap: 10px; }
.heritage-auth .auth-method-option { display: flex; align-items: center; gap: 8px; padding: 10px; min-height: 44px; flex: 1 1 140px; border: 1px solid var(--hd-border); border-radius: 8px; cursor: pointer; margin: 0; }
.heritage-auth .auth-method-option:has(input:checked) { background: var(--hd-sage); border-color: #829580; }
.heritage-auth .auth-method-option-label { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; }
.heritage-auth-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; color: var(--hd-muted); font-size: .73rem; padding-top: 18px; }
.heritage-auth-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.heritage-auth-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.heritage-auth .skip-link { position: absolute; left: 12px; top: 8px; transform: translateY(-200%); background: white; padding: 12px; z-index: 10; }
.heritage-auth .skip-link:focus { transform: translateY(0); }
.heritage-auth-tracking { display: none; visibility: hidden; border: 0; }
@media (max-width: 850px) {
    .heritage-auth-shell { max-width: 660px; padding: 20px 24px; }
    .heritage-auth-workspace { grid-template-columns: minmax(0, 1fr); }
    .heritage-auth-context { display: none; }
    .heritage-auth-content { padding: 30px 36px; }
}
@media (max-width: 480px) {
    .heritage-auth-shell { padding: 16px 16px 24px; }
    .heritage-auth-brandbar { margin-bottom: 16px; gap: 12px; }
    .heritage-auth-logo img { width: 145px; height: auto; }
    .heritage-auth-back { font-size: .72rem; }
    .heritage-auth-back .dna-icon { display: none; }
    .heritage-auth-content { padding: 24px 18px; }
    .heritage-auth .auth-form-card { gap: 18px; }
    .heritage-auth .auth-form-title { font-size: 2.15rem; }
    .heritage-auth-footer { padding-top: 14px; }
    .heritage-auth-footer nav { gap: 4px 16px; }
}
@media (prefers-reduced-motion: reduce) { .heritage-auth .spinner { animation: none; } }

.heritage-auth .checkbox .auth-form-label { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; }
.heritage-auth .checkbox .auth-form-label input { margin-top: 4px; }
