/* ============================================================
   LTLegalConnect — common styles
   Base page rules and shared utility classes of the app (buttons are LTButton). The font, the design tokens
   (--fs-*, --radius-*, --shadow-*...), svg.ico and the LT field rules live in the LTControls library
   (_content/LTControls/css/lt-base.css). Specific layout/component styles live in their .razor.css.
   ============================================================ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    color: var(--fg);
    background: var(--ubimia-ink-050);
    font-family: var(--font-sans);
    font-size: 14px;
    font-feature-settings: "kern";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   CONNECTION PILL — green/amber/red status indicator
   ============================================================ */
.conn-pill {
    align-items: center;
    background: var(--conn-bg);
    border: 1px solid var(--conn-border);
    border-radius: var(--radius-pill);
    color: var(--conn-fg);
    display: inline-flex;
    font-size: 11.5px;
    font-weight: var(--fw-semibold);
    gap: 8px;
    padding: 5px 12px 5px 10px;
}

.conn-pill .dot {
    background: var(--conn-dot);
    border-radius: var(--radius-pill);
    box-shadow: 0 0 0 3px var(--conn-glow);
    height: 7px;
    width: 7px;
    animation: conn-pulse 2s ease-in-out infinite;
}

.conn-pill__sub {
    border-left: 1px solid currentColor;
    color: inherit;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: var(--fw-semibold);
    margin-left: 2px;
    opacity: 0.7;
    padding-left: 8px;
}

.conn-pill.is-off {
    background: var(--ubimia-ink-100);
    border-color: var(--line);
    color: var(--fg-muted);
}

.conn-pill.is-off .dot {
    animation: none;
    background: var(--ubimia-ink-400);
    box-shadow: none;
}

.conn-pill.is-warn {
    background: var(--warning-soft);
    border-color: color-mix(in srgb, var(--deco-amber) 50%, transparent);
    color: var(--warning-fg);
}

.conn-pill.is-warn .dot {
    animation: none;
    background: var(--deco-amber);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--deco-amber) 18%, transparent);
}

.conn-pill.is-error {
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--deco-coral) 40%, transparent);
    color: var(--danger-strong);
}

.conn-pill.is-error .dot {
    animation: none;
    background: var(--deco-coral);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--deco-coral) 18%, transparent);
}

@keyframes conn-pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--conn-glow); }
    50%      { box-shadow: 0 0 0 6px var(--conn-glow-fade); }
}

/* ============================================================
   EYEBROW LABELS — the small uppercase section markers
   ============================================================ */
.eyebrow {
    color: var(--fg-muted);
    font-size: 10px;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ============================================================
   POPOVERS — light-weight floating panels (filter, role, etc.)
   ============================================================ */
.popover-backdrop {
    inset: 0;
    position: fixed;
    z-index: 39;
}

/* ============================================================
   ENVÍO — section boxes and placeholder fields shared by the
   SendMessage panels (Órgano destino, Traslado, Procedimiento, NIG,
   Intervinientes, Datos, Adjuntos).
   ============================================================ */
.envio-section {
    background: var(--ubimia-white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    position: relative;
}

.envio-section + .envio-section {
    margin-top: 14px;
}

.envio-section__header {
    align-items: baseline;
    background: var(--ubimia-white);
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 14px 16px;
}

.envio-section__title-group {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.envio-section__number {
    color: var(--fg-subtle);
    font-size: 11px;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.08em;
}

.envio-section__title {
    color: var(--ubimia-quantum-blue);
    font-size: 15px;
    font-weight: var(--fw-bold);
}

.envio-section__required {
    color: var(--ubimia-accent-coral);
    margin-left: 2px;
}

.envio-section__subtitle {
    color: var(--fg-muted);
    font-size: 12.5px;
}

.envio-section__actions {
    align-items: center;
    color: var(--fg-muted);
    display: flex;
    gap: 8px;
}

.envio-section__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
}

.envio-section--flat {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.envio-section--flat + .envio-section--flat {
    margin-top: 0;
}

.envio-section--flat > .envio-section__header {
    border-bottom: none;
    border-radius: 0;
    padding: 18px 24px 4px;
}

.envio-section--flat > .envio-section__body {
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 22px;
}

.envio-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Read-only view (a disabled <fieldset>, e.g. a sent message's "Ver ficha"): no placeholders and
   darker, bolder values so the data reads clearly. Kept global so it covers LTInput, LTSelect and
   plain textareas alike; the extra ":disabled" keeps it above each component's own disabled style. */
fieldset:disabled .lt-input input:disabled,
fieldset:disabled .lt-select__input:disabled,
fieldset:disabled textarea:disabled {
    -webkit-text-fill-color: var(--ubimia-ink-900);
    color: var(--ubimia-ink-900);
    cursor: default;
    font-weight: var(--fw-semibold);
    opacity: 1;
}

fieldset:disabled .lt-input input:disabled::placeholder,
fieldset:disabled .lt-select__input:disabled::placeholder,
fieldset:disabled textarea:disabled::placeholder {
    color: transparent;
    -webkit-text-fill-color: transparent;
}
