/* ========================================================================
   UDRINK · Mi cuenta · cliente WASM
   CSS mínimo + SHIMS de Tailwind utility classes que NO están en el
   `tailwind-udrink.css` precompilado del cliente (sin pipeline JIT).
   Todas las clases definidas acá replican los nombres del prototipo
   standalone para no reescribir el markup del Razor.
   ======================================================================== */

/* ╔════════════════════════════════════════════════════════════════╗
   ║   TAILWIND SHIMS · clases que el CSS precompilado no incluye    ║
   ╚════════════════════════════════════════════════════════════════╝ */

/* ── Layout · max-widths ── */
.max-w-3xl { max-width: 48rem; }

/* ── Positioning utilities faltantes ── */
.inset-x-0    { left: 0; right: 0; }
.left-1\/2    { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }
.-right-0\.5  { right: -2px; }
.-top-0\.5    { top: -2px; }
.w-1\/2       { width: 50%; }

/* ── Spacing half-step (Tailwind .5 scale = 0.125rem chunks) ── */
.gap-0\.5     { gap: .125rem; }
.gap-1\.5     { gap: .375rem; }
.gap-2\.5     { gap: .625rem; }
.gap-3\.5     { gap: .875rem; }

.py-0\.5      { padding-top: .125rem; padding-bottom: .125rem; }
.py-3\.5      { padding-top: .875rem; padding-bottom: .875rem; }
.pl-3\.5      { padding-left: .875rem; }
.pr-3\.5      { padding-right: .875rem; }
.px-3\.5      { padding-left: .875rem; padding-right: .875rem; }
.pr-11        { padding-right: 2.75rem; }
.pr-12        { padding-right: 3rem; }

/* ── Border weight arbitrary ── */
.border-\[1\.5px\] { border-width: 1.5px; }

/* ── Casing reset ── */
.normal-case { text-transform: none; }

/* ── Rings arbitrary ── */
.ring-\[3px\] { box-shadow: 0 0 0 3px var(--tw-ring-color, rgba(17,82,212,.15)); }

/* ── Colors complementarios faltantes ── */
.text-success         { color: #10B981; }
.text-muted\/80       { color: rgba(76, 102, 154, .8); }
.text-white\/90       { color: rgba(255, 255, 255, .9); }
.text-primary         { color: #1152D4; }
.hover\:text-primary:hover { color: #1152D4; }

/* ── Reset margens/padding/border ── */
.m-0     { margin: 0; }
.p-0     { padding: 0; }
.border-0{ border-width: 0; }
.mb-0\.5 { margin-bottom: .125rem; }

/* ── Alturas mínimas arbitrary ── */
.min-h-\[16px\] { min-height: 16px; }

/* ── Z-index arbitrary ── */
.z-\[1\] { z-index: 1; }
.z-\[2\] { z-index: 2; }
.z-\[3\] { z-index: 3; }
.z-\[4\] { z-index: 4; }
.z-\[5\] { z-index: 5; }

/* ── Tracking ── */
.tracking-normal { letter-spacing: 0; }

/* ── Responsive variants comunes ── */
.lg\:hidden { /* default visible */ }
@media (min-width: 1024px) {
    .lg\:hidden { display: none !important; }
}
@media (min-width: 640px) {
    .sm\:gap-2 { gap: .5rem; }
}

/* ── Hover/focus utilities adicionales ── */
.hover\:border-primary:hover { border-color: #1152D4; }
.hover\:bg-primary-soft:hover { background-color: #E7EBF3; }
.group:hover .group-hover\:text-primary { color: #1152D4; }

/* ── Cursor utilities ── */
.cursor-not-allowed { cursor: not-allowed; }

/* ── min/max-w-md (modal) ── */
.max-w-md { max-width: 28rem; }

/* ── Truncate (puede faltar) ── */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Colors · custom UDRINK ── */
.bg-primary-soft       { background-color: #E7EBF3; }
.hover\:bg-primary-soft:hover   { background-color: #E7EBF3; }
.bg-primary-hover      { background-color: #0F4BC4; }
.hover\:bg-primary-hover:hover  { background-color: #0F4BC4; }
.bg-bg                 { background-color: #F6F7F8; }
.hover\:bg-bg:hover    { background-color: #F6F7F8; }
.bg-success-soft       { background-color: #ECFDF5; }
.bg-danger             { background-color: #C03030; }
.bg-danger-soft        { background-color: #FFF1F2; }

.text-ink              { color: #0D121B; }
.text-ink-2            { color: #1F2937; }
.text-muted            { color: #4C669A; }
.text-warning          { color: #D97706; }
.text-danger           { color: #C03030; }

.border-line           { border-color: #E7EBF3; }
.hover\:border-line-2:hover { border-color: #D6DBE5; }
.focus-within\:border-primary:focus-within { border-color: #1152D4; }
.focus\:border-primary:focus { border-color: #1152D4; }
.border-success\/25    { border-color: rgba(16, 185, 129, .25); }

.text-muted\/80        { color: rgba(76, 102, 154, .8); }

/* ── Gradient stops (avatar) ── */
.from-primary { --tw-gradient-from: #1152D4; --tw-gradient-to: rgba(17,82,212,0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-\[\#4A7DDE\] { --tw-gradient-to: #4A7DDE; }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops, #1152D4, #4A7DDE)); }

/* ── Shadows custom ── */
.shadow-card { box-shadow: 0 8px 20px -14px rgba(15, 23, 42, .18); }
.shadow-pop  { box-shadow: 0 16px 40px -22px rgba(15, 23, 42, .35); }
.shadow-btn  { box-shadow: 0 4px 12px -6px rgba(17, 82, 212, .55); }

/* ── Rings ── */
.focus\:ring-\[3px\]:focus { box-shadow: 0 0 0 3px var(--tw-ring-color, rgba(17,82,212,.15)); }
.focus\:ring-primary\/15:focus { --tw-ring-color: rgba(17, 82, 212, .15); }
.focus-within\:ring-\[3px\]:focus-within { box-shadow: 0 0 0 3px var(--tw-ring-color, rgba(17,82,212,.15)); }
.focus-within\:ring-primary\/15:focus-within { --tw-ring-color: rgba(17, 82, 212, .15); }

/* ── Font sizes (arbitrary values) ── */
.text-\[11px\]    { font-size: 11px;   line-height: 1.45; }
.text-\[12\.5px\] { font-size: 12.5px; line-height: 1.5;  }
.text-\[13px\]    { font-size: 13px;   line-height: 1.5;  }
.text-\[13\.5px\] { font-size: 13.5px; line-height: 1.5;  }
.text-\[14px\]    { font-size: 14px;   line-height: 1.5;  }
.text-\[15px\]    { font-size: 15px;   line-height: 1.4;  }
.text-\[20px\]    { font-size: 20px;   line-height: 1.3;  }
.text-\[22px\]    { font-size: 22px;   line-height: 1.2;  }
.text-\[28px\]    { font-size: 28px;   line-height: 1.2;  }
.text-\[36px\]    { font-size: 36px;   line-height: 1.2;  }
.text-\[44px\]    { font-size: 44px;   line-height: 1.2;  }

/* sm: variants para sizes arbitrary ── */
@media (min-width: 640px) {
    .sm\:text-\[13px\] { font-size: 13px; }
    .sm\:text-\[20px\] { font-size: 20px; }
    .sm\:text-\[44px\] { font-size: 44px; }
    .sm\:w-\[72px\]    { width: 72px; }
    .sm\:h-\[72px\]    { height: 72px; }
    .sm\:pb-\[140px\]  { padding-bottom: 140px; }
    .sm\:p-5           { padding: 1.25rem; }
    .sm\:px-4          { padding-left: 1rem; padding-right: 1rem; }
    .sm\:py-5          { padding-top: 1.25rem; padding-bottom: 1.25rem; }
    .sm\:gap-2\.5      { gap: .625rem; }
    .sm\:gap-3         { gap: .75rem; }
    .sm\:gap-4         { gap: 1rem; }
    .sm\:grid-cols-2   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:h-12          { height: 3rem; }
    .sm\:text-sm       { font-size: .875rem; }
    .sm\:text-lg       { font-size: 1.125rem; }
}

/* ── Dimensions arbitrary ── */
.w-\[26px\]      { width: 26px; }
.h-\[26px\]      { height: 26px; }
.w-\[72px\]      { width: 72px; }
.h-\[72px\]      { height: 72px; }
.h-\[46px\]      { height: 46px; }
.h-\[60px\]      { height: 60px; }
.pb-\[160px\]    { padding-bottom: 160px; }
.pb-\[140px\]    { padding-bottom: 140px; }
.pb-\[calc\(0\.75rem\+env\(safe-area-inset-bottom\)\)\] { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
.min-h-\[calc\(100vh-60px\)\] { min-height: calc(100vh - 60px); }

/* ── Grid templates arbitrary ── */
.grid-cols-\[40px_1fr_40px\] { grid-template-columns: 40px 1fr 40px; }
.grid-cols-\[auto_1fr\]      { grid-template-columns: auto 1fr; }

/* ── Z-index ── */
.z-25 { z-index: 25; }

/* ── Active / hover transforms arbitrary ── */
.active\:scale-\[\.99\]:active   { transform: scale(.99); }
.active\:scale-\[\.98\]:active   { transform: scale(.98); }
.active\:scale-\[\.97\]:active   { transform: scale(.97); }
.hover\:scale-\[1\.03\]:hover    { transform: scale(1.03); }
.hover\:scale-\[1\.08\]:hover    { transform: scale(1.08); }
.hover\:scale-\[1\.12\]:hover    { transform: scale(1.12); }
.group:hover .group-hover\:translate-x-0\.5 { transform: translateX(2px); }
.group:hover .group-hover\:text-primary     { color: #1152D4; }
.active\:translate-y-px:active   { transform: translateY(1px); }
.hover\:px-2\.5:hover { padding-left: .625rem; padding-right: .625rem; }

/* ── Backdrop blur ── */
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ── Box-shadow inline (drop shadows + glows) ── */
.shadow-\[0_10px_24px_-10px_rgba\(17\,82\,212\,0\.45\)\]   { box-shadow: 0 10px 24px -10px rgba(17, 82, 212, .45); }
.shadow-\[0_4px_10px_-4px_rgba\(17\,82\,212\,0\.45\)\]    { box-shadow: 0 4px 10px -4px rgba(17, 82, 212, .45); }
.shadow-\[0_4px_10px_-4px_rgba\(192\,48\,48\,0\.55\)\]    { box-shadow: 0 4px 10px -4px rgba(192, 48, 48, .55); }
.shadow-\[0_-8px_24px_-16px_rgba\(15\,23\,42\,0\.25\)\]   { box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, .25); }

/* ── Backgrounds transparentes ── */
.bg-white\/90     { background-color: rgba(255, 255, 255, .9); }
.bg-slate-900\/55 { background-color: rgba(15, 23, 42, .55); }

/* ── Disabled helpers ── */
.disabled\:opacity-60:disabled { opacity: .6; }

/* ── Placeholder slate-400 (en caso de no estar precompilado) ── */
.placeholder\:text-slate-400::placeholder { color: #94A3B8; }

/* ── Pointer events (sometimes missing) ── */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ╔════════════════════════════════════════════════════════════════╗
   ║   CSS específico del componente (custom · no Tailwind)          ║
   ╚════════════════════════════════════════════════════════════════╝ */

/* ── Globales responsivos ── */
html, body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;        /* iOS Safari no infla texto al rotar */
    text-size-adjust: 100%;
}
* { min-width: 0; }                          /* permite que flex/grid children encojan sin overflow */

/* Material Symbols default tuning (alineación + size base). */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    line-height: 1;
}

/* ── Input radio visualmente oculto pero accesible (sr-only). ──
   Click llega al <label>, que activa el input por contención HTML. */
.sr-only-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

/* ── Radio chip: estado seleccionado ──
   Se aplica de 3 formas para máxima compatibilidad cross-browser:
   1) Clase .is-selected que añade JS al chip (más confiable).
   2) Selector adyacente input:checked + span (clásico).
   3) :has(input:checked) (moderno, Chrome 105+/Firefox 121+/Safari 15.4+).
*/
.ud-radio-chip.is-selected > span,
.ud-radio-chip input:checked + span,
.ud-radio-chip:has(input:checked) > span {
    background: #1152D4 !important;       /* primary */
    color: #FFFFFF !important;
    border-color: #1152D4 !important;
    box-shadow: 0 4px 12px -6px rgba(17, 82, 212, .55);
}
.ud-radio-chip:active > span {
    transform: scale(.97);
}
.ud-radio-chip:focus-within > span {
    outline: 3px solid rgba(17, 82, 212, .25);
    outline-offset: 2px;
}

/* ── Avatar con foto: el <img> reemplaza a la silueta default,
   que desaparece al renderizarse condicionalmente en Razor. */

/* Hover del avatar y de la cámara: animación combinada visible */
.ud-avatar:focus-visible {
    outline: 3px solid rgba(17, 82, 212, .35);
    outline-offset: 2px;
}

/* ── Input date: ocultar indicador nativo (Chrome) y dejar nuestro ícono ──
   El input sigue clickeable en toda su superficie (incluyendo el área del
   indicador nativo invisible) para abrir el picker. */
.ud-input--date::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 44px;
    height: 100%;
    cursor: pointer;
}
.ud-input--date::-webkit-inner-spin-button,
.ud-input--date::-webkit-clear-button {
    display: none;
}

/* ── Spinner del logout (Tailwind animate-spin usa border tonos azules
   por default; necesitamos rojo danger para feedback "saliendo"). ── */
.ud-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(192, 48, 48, .22);
    border-top-color: #C03030;            /* danger */
    animation: ud-spin .7s linear infinite;
}
@keyframes ud-spin {
    to { transform: rotate(360deg); }
}

/* ── Row logout · estados busy / success / leaving (transiciones suaves) ── */
.ud-row-logout.is-busy {
    background: #FFF1F2;                  /* danger-soft */
    pointer-events: none;
    padding-left: .625rem;
    padding-right: .625rem;
}
.ud-row-logout.is-busy #row-logout-title { color: #C03030; }
.ud-row-logout.is-busy #row-logout-sub   { color: #C03030; opacity: .75; }

.ud-row-logout.is-success {
    background: #ECFDF5;                  /* success-soft */
    pointer-events: none;
    padding-left: .625rem;
    padding-right: .625rem;
}
.ud-row-logout.is-success #row-logout-title { color: #10B981; }
.ud-row-logout.is-success #row-logout-sub   { color: #10B981; opacity: .85; }
.ud-row-logout.is-success #row-logout-icon  { color: #10B981; }

.ud-row-logout.is-leaving {
    opacity: .55;
    transform: translateY(-2px);
    transition: opacity .4s ease, transform .4s ease;
}

/* Mientras está busy/success, anular el hover (para que no se "ponga azul"). */
.ud-row-logout.is-busy:hover,
.ud-row-logout.is-success:hover {
    background: inherit;
}

/* ── Save bar: slide-up al aparecer ── */
.ud-save-bar {
    transform: translateY(110%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.ud-save-bar:not([hidden]) {
    transform: translateY(0);
}

/* ── Modal: backdrop muestra flex cuando NO está hidden ── */
.ud-modal-backdrop:not(.hidden) {
    display: flex;
}

/* Reset focus-ring nativo inputs readonly (no debe verse "editable"). */
input[readonly]:focus {
    box-shadow: none !important;
    border-color: #E7EBF3 !important;
}
