/* TRIAGE X-RAY Express - estilo clinico oscuro */
.tx-app, .tx-app *, .tx-app *::before, .tx-app *::after {
    box-sizing: border-box;
}

.tx-app {
    --tx-bg:        #111110;
    --tx-bg2:       #1A1A18;
    --tx-bg3:       #222220;
    --tx-ink:       #F2F0EB;
    --tx-ink2:      #A8A59E;
    --tx-ink3:      #5A5A54;
    --tx-gold:      #F5A623;
    --tx-gold-bg:   rgba(245,166,35,0.10);
    --tx-red:       #E03530;
    --tx-red-bg:    rgba(224,53,48,0.12);
    --tx-green:     #22A05A;
    --tx-border:    rgba(242,240,235,0.08);
    --tx-border2:   rgba(242,240,235,0.14);

    background: var(--tx-bg);
    color: var(--tx-ink);
    font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
    padding: 0;
    margin: 0 auto;
    max-width: 100%;
    border: 1px solid var(--tx-border);
}

/* Topbar */
.tx-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--tx-border);
    background: var(--tx-bg);
}
.tx-logo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tx-ink);
}
.tx-logo span { color: var(--tx-gold); }
.tx-logo-sep { color: var(--tx-ink3); margin: 0 4px; }
.tx-topbar-right {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--tx-ink3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Progress */
.tx-progress-bar { height: 2px; background: var(--tx-border); }
.tx-progress-fill {
    height: 100%;
    width: 0;
    background: var(--tx-gold);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main */
.tx-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* Screens */
.tx-screen { display: none; }
.tx-screen.tx-active {
    display: block;
    animation: tx-up 0.3s ease both;
}
@keyframes tx-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.tx-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tx-ink3);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tx-eyebrow::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tx-border);
}
.tx-h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 38px;
    line-height: 1.05;
    letter-spacing: 0.005em;
    color: var(--tx-ink);
    margin-bottom: 20px;
    font-weight: 400;
}
.tx-gold { color: var(--tx-gold); }
.tx-red { color: var(--tx-red); }
.tx-lead {
    font-size: 15px;
    line-height: 1.65;
    color: var(--tx-ink2);
    margin-bottom: 28px;
    font-weight: 300;
}
.tx-frase {
    border-left: 2px solid var(--tx-gold);
    background: var(--tx-gold-bg);
    padding: 16px 18px;
    margin-bottom: 28px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--tx-ink2);
    font-style: italic;
}

/* Buttons - blindados contra themes agresivos */
.tx-app .tx-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 52px !important;
    padding: 14px 24px !important;
    border: 1px solid transparent !important;
    background: transparent;
    color: var(--tx-ink) !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    text-decoration: none !important;
    text-transform: none;
    line-height: 1.2 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.tx-app .tx-btn-primary,
.tx-app .tx-btn-primary:link,
.tx-app .tx-btn-primary:visited {
    background: var(--tx-gold) !important;
    color: #1a1a18 !important;
    border-color: var(--tx-gold) !important;
}
.tx-app .tx-btn-primary:hover:not(:disabled),
.tx-app .tx-btn-primary:focus:not(:disabled),
.tx-app .tx-btn-primary:active:not(:disabled) {
    background: #ffb733 !important;
    color: #1a1a18 !important;
    border-color: #ffb733 !important;
    transform: translateY(-1px);
    outline: none;
}
.tx-app .tx-btn-primary:disabled {
    background: var(--tx-gold) !important;
    color: #1a1a18 !important;
    opacity: 0.35;
    cursor: not-allowed !important;
}
.tx-app .tx-btn-ghost {
    border: 1px solid var(--tx-border2) !important;
    color: var(--tx-ink2) !important;
    background: transparent !important;
    font-size: 12px !important;
    font-family: 'IBM Plex Mono', monospace !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    min-height: 44px !important;
}
.tx-app .tx-btn-ghost:hover:not(:disabled),
.tx-app .tx-btn-ghost:focus:not(:disabled) {
    border-color: var(--tx-gold) !important;
    color: var(--tx-gold) !important;
    background: transparent !important;
    outline: none;
}
.tx-app .tx-btn-ghost:disabled { cursor: default !important; opacity: 0.7; }

.tx-meta-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tx-ink3);
    text-align: center;
    margin: 14px 0 0;
    padding: 0;
}

/* Options (radio) */
.tx-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}
.tx-option {
    display: flex;
    align-items: stretch;
    gap: 14px;
    background: var(--tx-bg2);
    border: 1px solid var(--tx-border2);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.tx-option input[type="radio"] {
    display: none;
}
.tx-option-pill {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tx-ink2);
    border: 1px solid var(--tx-border2);
    background: var(--tx-bg3);
    flex-shrink: 0;
    transition: all 0.2s;
}
.tx-option-text {
    font-size: 14px;
    line-height: 1.45;
    color: var(--tx-ink);
    align-self: center;
}
.tx-option:hover {
    border-color: var(--tx-gold);
}
.tx-option:hover .tx-option-pill {
    border-color: var(--tx-gold);
    color: var(--tx-gold);
}
.tx-option.tx-checked {
    border-color: var(--tx-gold);
    background: var(--tx-gold-bg);
}
.tx-option.tx-checked .tx-option-pill {
    background: var(--tx-gold);
    color: #1a1a18;
    border-color: var(--tx-gold);
}

/* Textareas / inputs */
.tx-textarea, .tx-input {
    width: 100%;
    background: var(--tx-bg2);
    border: 1px solid var(--tx-border2);
    color: var(--tx-ink);
    padding: 14px 16px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}
.tx-textarea {
    resize: vertical;
    min-height: 120px;
}
.tx-textarea:focus, .tx-input:focus {
    outline: none;
    border-color: var(--tx-gold);
}
.tx-textarea::placeholder, .tx-input::placeholder {
    color: var(--tx-ink3);
}
.tx-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--tx-ink3);
    text-align: right;
    margin-top: 6px;
    margin-bottom: 24px;
}

/* Telefono con selector de pais */
.tx-app .tx-phone {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.tx-app .tx-phone-cc {
    flex: 0 0 auto;
    width: auto;
    min-width: 130px;
    max-width: 190px;
    cursor: pointer;
    padding-right: 8px;
}
.tx-app .tx-phone-local {
    flex: 1 1 auto;
    min-width: 0;
}
.tx-app .tx-phone-hint {
    display: block;
    margin-top: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--tx-ink3);
}
@media (max-width: 420px) {
    .tx-app .tx-phone { flex-direction: column; }
    .tx-app .tx-phone-cc { max-width: none; width: 100%; }
}

/* Fields contact */
.tx-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}
.tx-field {
    display: flex;
    flex-direction: column;
}
.tx-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tx-ink3);
    margin-bottom: 6px;
}
.tx-consent label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--tx-ink2);
    line-height: 1.5;
    cursor: pointer;
}
.tx-consent input { margin-top: 4px; accent-color: var(--tx-gold); }

/* Nav */
.tx-nav {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.tx-nav .tx-btn { margin-bottom: 0; }
.tx-nav .tx-btn-ghost { max-width: 140px; }

/* Error */
.tx-error {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--tx-red-bg);
    border: 1px solid rgba(224, 53, 48, 0.35);
    color: #ff8e8b;
    font-size: 13px;
    font-family: 'IBM Plex Mono', monospace;
}

/* Oculta de forma robusta (gana al display:inline-flex !important de los botones,
   que el atributo nativo 'hidden' no puede sobreescribir). */
.tx-app .tx-gone { display: none !important; }

/* Calendario bloqueado (form de agenda en un solo paso): se muestra el calendario
   real atenuado, con un overlay encima, hasta que el form esta completo. */
.tx-cal-shell {
    position: relative;
    margin-top: 28px;
}
.tx-cal-shell .tx-cal-inner {
    transition: filter 0.35s ease, opacity 0.35s ease;
}
.tx-cal-shell.tx-locked .tx-cal-inner {
    filter: blur(3px) grayscale(0.35);
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}
.tx-cal-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}
.tx-cal-shell:not(.tx-locked) .tx-cal-overlay {
    display: none;
}
.tx-cal-overlay-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tx-ink);
    margin: 0;
    padding: 14px 20px;
    background: rgba(17, 17, 16, 0.82);
    border: 1px solid var(--tx-gold);
}

/* CTA final */
.tx-cta {
    margin-top: 28px;
    padding: 24px;
    background: var(--tx-bg2);
    border: 1px solid var(--tx-border2);
    border-top: 2px solid var(--tx-gold);
    text-align: center;
}
.tx-cta .tx-btn-primary { width: auto; min-width: 240px; }

/* Responsive */
@media (max-width: 540px) {
    .tx-h1 { font-size: 30px; }
    .tx-main { padding: 24px 16px 60px; }
    .tx-nav { flex-direction: column-reverse; }
    .tx-nav .tx-btn-ghost { max-width: none; }
}
