/* Orbit shared control spec — mirrors the Appointment System prototype
   (.field / .field label / .input / .select / .input.mono / .field textarea
    from app.css + app-extra.css). Tokens come from orbit-tokens.css. */

/* Container
   NOTE: .field is an unscoped global selector. It intentionally matches native-input
   wrappers in the data-entry forms (RelatedPersonSection, DemographicsSection,
   InsuranceSection). Do not add this class to elements outside those forms without
   checking for collisions first. */
.field,
.orbit-mud-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* Label (prototype .field label) */
.field > label,
.orbit-mud-field > label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-2);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Native controls (prototype .input / .select / .field input) */
.control,
.field > input,
.field > select,
.field > textarea {
    font-family: inherit;
    font-size: 13px;
    color: var(--fg-1);
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: #fff; /* intentional: prototype uses white; revisit when dark-mode token added */
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--dur-fast) var(--ease-std),
                box-shadow var(--dur-fast) var(--ease-std);
}
.control.mono,
.field > .mono {
    font-family: var(--font-mono);
}
/* Textarea (prototype .field textarea) */
.field > textarea {
    min-height: 80px;
    resize: vertical;
}
.orbit-mud-field textarea.mud-input-slot {
    resize: vertical;
}
.control:focus,
.field > input:focus,
.field > select:focus,
.field > textarea:focus {
    border-color: rgb(var(--primary-rgb));
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.10);
}
.control:read-only,
.control[readonly],
.field > input[readonly] {
    background: var(--bg-surface-3);
    color: var(--fg-2);
    cursor: default;
}
.control:disabled,
.field > input:disabled,
.field > select:disabled,
.field > textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.control.is-error,
.control[aria-invalid="true"] {
    border-color: rgb(var(--danger-rgb, 230 83 60));
    box-shadow: 0 0 0 3px rgba(var(--danger-rgb, 230 83 60), 0.10);
}

/* MudBlazor controls — mirror the same spec onto the inner .mud-input box.
   Variant.Text strips filled/outlined chrome. MudTextField also accepts Underline=false;
   MudSelect does not (param is silently swallowed), so we suppress the line via CSS below.
   DOM verified against MudBlazor 9.5.0: .mud-input is display:inline-flex (the border box),
   .mud-input-root is the actual <input> or focusable <div tabindex=0> (MudSelect).
   Specificity note: our selectors are 0,2,0 or 0,3,0, vs MudBlazor's 0,1,0 — no !important
   needed on .mud-input itself. Only the inner padding needs it to beat Orbit.DesignSystem's
   .mud-input > input.mud-input-root rule at 0,2,1 + !important.
   Width note: MudBlazor.min.css loads AFTER this file, so mud-full-width alone is unreliable.
   We explicitly force .mud-input-control to 100% width here so the full chain is covered. */
.orbit-mud-field .mud-input-control {
    width: 100%;
}
.orbit-mud-field .mud-input {
    display: flex;           /* override inline-flex; 0,2,0 beats MudBlazor's 0,1,0 */
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;        /* override MudBlazor's 1.1876em; inner input inherits this for 1lh below */
    color: var(--fg-1);
    width: 100%;
    padding: 0.55rem 0.8rem; /* wrapper carries all padding — .mud-input-root is zeroed below */
    background: #fff;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    transition: border-color var(--dur-fast) var(--ease-std),
                box-shadow var(--dur-fast) var(--ease-std);
}
/* Zero MudBlazor's inner padding so the wrapper is the sole vertical sizing surface.
   height:1lh = 1 × computed line-height (1.5 × 13px = 19.5px), matching native .control's
   content area. Padding-only !important: beats Orbit.DesignSystem's 0,2,1 + !important rule. */
.orbit-mud-field .mud-input .mud-input-root {
    padding: 0 !important;
    height: 1lh;
}
.orbit-mud-field .mud-input:focus-within {
    border-color: rgb(var(--primary-rgb));
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.10);
}
.orbit-mud-field .mud-input-error .mud-input {
    border-color: rgb(var(--danger-rgb, 230 83 60));
    box-shadow: 0 0 0 3px rgba(var(--danger-rgb, 230 83 60), 0.10);
}
/* MudSelect does not accept Underline=false — suppress the Material underline via CSS. */
.orbit-mud-field .mud-input-underline::before,
.orbit-mud-field .mud-input-underline::after {
    display: none !important;
}

/* Checkbox — keep the Orbit primary color; label inherits control typography */
.orbit-mud-checkbox .mud-checkbox-input:checked ~ .mud-icon-root,
.orbit-mud-checkbox .mud-checked { color: rgb(var(--primary-rgb)) !important; }

/* Required marker — the visible asterisk beside a wrapper label. The accessible half of the same
   contract is the input's own required/aria-required, so this glyph is hidden from assistive tech. */
.orbit-required-mark {
    color: rgb(var(--danger-rgb, 220 53 69));
    font-weight: 700;
    line-height: 1;
}

/* ── Section skeletons (appointments-visual-loading, Phase 2A, design D15) ──────────────
   Decorative blocks rendered by Components/Shared/OrbitSkeleton.razor while a region loads.
   Only opacity/background-position animate (never dimensions); shimmer is off under
   prefers-reduced-motion. Heights mirror the real rows they stand in for. */
.orbit-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.orbit-skeleton {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.orbit-skeleton__block {
    display: block;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--gray-3, #e6eaeb) 25%, var(--gray-2, #f2f4f5) 50%, var(--gray-3, #e6eaeb) 75%);
    background-size: 200% 100%;
    animation: orbit-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes orbit-skeleton-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .orbit-skeleton__block {
        animation: none;
        background: var(--gray-3, #e6eaeb);
    }
}

.orbit-skeleton__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border, #e8ecf0);
    min-width: 0;
}

.orbit-skeleton__row:last-child {
    border-bottom: 0;
}

.orbit-skeleton__row--stat {
    padding: 8px 0;
    border-bottom: 0;
}

.orbit-skeleton__row--result {
    padding: 10px 14px;
}

.orbit-skeleton__row--table {
    padding: 14px 10px;
    gap: 20px;
}

.orbit-skeleton__avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.orbit-skeleton__icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.orbit-skeleton__chevron {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.orbit-skeleton__lines {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.orbit-skeleton__lines--end {
    flex: 0 0 80px;
    align-items: flex-end;
}

.orbit-skeleton__line {
    height: 14px;
    max-width: 100%;
}

.orbit-skeleton__line--sm {
    height: 11px;
}

.orbit-skeleton__line--xs {
    height: 10px;
}

.orbit-skeleton__line--lg {
    height: 18px;
}

.orbit-skeleton__line--btn {
    height: 28px;
    margin-top: 4px;
}

.orbit-skeleton__cell {
    height: 13px;
    flex: 0 1 auto;
}

.orbit-skeleton__cell--end {
    height: 26px;
    margin-left: auto;
}

.orbit-skeleton--cards {
    gap: 10px;
}

.orbit-skeleton__card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: var(--radius-md, 0.35rem);
    background: var(--bg-surface, #fff);
}
