/* Housing Court Filer — Shared components.
   Cards, buttons, tab bars and dialogs, drawn once for the whole system from the approved /calendar
   and Case detail screens (docs/design/DESIGN-RULES.md). Linked after every page stylesheet and just
   before typography.css, so a page's blanket reset (`.x-page button{background:none}`) cannot undo
   them. Pages place and size these components; they never redraw them. ComponentContractTests holds
   every stylesheet and every page's markup to that. Fields are in app.css. */

/* Shared card, from the /calendar screen: every card in the system is a .standard-card (or one of
   the older panel names below, drawn the same way). Pages set a card's layout and inner spacing, never
   its surface, border, corners or shadow. A card's <header> carries its title and actions. */
.standard-card,.hcf-workspace-panel,.hcf-component-lab,.hcf-card{background:var(--hcf-surface);border:1px solid var(--hcf-line);border-radius:10px;box-shadow:var(--hcf-shadow-sm)}
.standard-card>header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--hcf-line)}
.standard-card>header h2{margin:0}

/* Shared buttons, from the /calendar screen: 40px, 8px corners, slate. Every action button carries one
   of these classes; pages place a button (margin, width, flex) but never redraw it. */
:is(button,a,span,label).hcf-button,:is(button,a,span,label).hcf-button-secondary,:is(button,a,span,label).hcf-button-danger{min-height:40px;padding:0 16px;border:1px solid var(--hcf-action);border-radius:8px;display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none;white-space:nowrap;cursor:pointer;box-shadow:none}
:is(button,a,span,label).hcf-button-compact{min-height:32px;padding:0 12px}
:is(button,a,span).hcf-icon-button{width:40px;height:40px;min-height:0;padding:0;border:1px solid var(--hcf-line);border-radius:10px;background:var(--hcf-surface);color:var(--hcf-text);display:inline-grid;place-items:center;cursor:pointer;flex:none}
:is(button,a,span).hcf-icon-button:hover{background:var(--hcf-action-soft)}
/* A row or toolbar icon action is the compact icon button: 32px, 8px corners. */
:is(button,a,span).hcf-icon-button.hcf-button-compact{width:32px;height:32px;border-radius:8px}
/* Sprite symbols need their size and outline style on the referencing SVG. */
.hcf-icon-button > svg.icon{display:block;width:1.125rem;height:1.125rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* Colours are element-qualified too: at one class they would lose to a page's `.x-page button{color:inherit}`. */
:is(button,a,span,label).hcf-button{background:var(--hcf-action);color:var(--hcf-text-inverse)}
:is(button,a,span,label).hcf-button:hover{background:var(--hcf-action-hover);border-color:var(--hcf-action-hover);color:var(--hcf-text-inverse)}
/* Green primary actions retain the shared button shape and type. */
:is(button,a,span,label).hcf-button.hcf-button-success,:is(button,a,span,label).hcf-button.hcf-button-success:hover{background:var(--hcf-green);border-color:var(--hcf-green);color:var(--hcf-text-inverse)}
:is(button,a,span,label).hcf-button.hcf-button-success:hover{filter:brightness(.9)}
:is(button,a,span,label).hcf-button-secondary{background:var(--hcf-surface);border-color:var(--hcf-action-line);color:var(--hcf-text-action)}
:is(button,a,span,label).hcf-button-secondary:hover{border-color:var(--hcf-action);background:var(--hcf-action-soft)}
/* Danger wins over .hcf-button when an element carries both. */
:is(button,a,span,label).hcf-button-danger,:is(button,a,span,label).hcf-button-danger:hover{background:var(--hcf-danger);border-color:var(--hcf-danger);color:var(--hcf-text-inverse)}
:is(button,a,span,label).hcf-button-danger:hover{filter:brightness(.92)}
:is(button,a,span,label):is(.hcf-button,.hcf-button-secondary,.hcf-button-danger,.hcf-icon-button):disabled,button:disabled{opacity:.55;cursor:not-allowed}

/* Shared tab bar. Every tab bar in the system carries .hcf-tabs and is drawn like the Case detail
   bar it was taken from: a white rounded strip, rounded tabs, and the chosen tab filled navy. Pages
   only place the bar (margin, width); its shape and text belong here and in typography.css. Held at
   two-class weight so a page's blanket button reset cannot undo it. */
.hcf-tabs{display:flex;gap:5px;padding:5px;border:1px solid var(--hcf-line);border-radius:14px;background:var(--hcf-surface);overflow-x:auto}
.hcf-tabs :is(button,a,[role=tab]){flex:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:0;margin:0;padding:10px 16px;border:0;border-radius:9px;background:none;box-shadow:none;white-space:nowrap;text-decoration:none;cursor:pointer}
.hcf-tabs :is(.active,[aria-selected=true],[aria-current=page]){background:var(--hcf-navy)}

/* Shared dialog, from the /calendar preview: a dimmed backdrop, a white panel with 18px corners and a
   deep shadow, a white header (title, subtitle, a bordered close button) over a line, and an optional
   footer of actions over a line. A drawer is the same panel docked to the right edge at full height.
   Pages size a dialog (width, max-height) and lay out its body; they never redraw its chrome. */
.hcf-dialog-backdrop{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;justify-content:normal;padding:4vh 20px;background:rgba(7,24,43,.44)}
.hcf-dialog-backdrop.hcf-dialog-backdrop-drawer{place-items:stretch end;padding:0}
.hcf-dialog{width:min(640px,100%);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;background:var(--hcf-surface);border:0;border-radius:18px;box-shadow:0 28px 80px rgba(8,29,52,.28);color:var(--hcf-text)}
.hcf-dialog.hcf-dialog-compact{width:min(26rem,100%)}
.hcf-dialog.hcf-dialog-drawer{width:min(760px,95vw);height:100%;max-height:none;border-radius:0;box-shadow:-20px 0 60px rgba(8,29,52,.2)}
.hcf-dialog>header{flex:none;min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0;padding:14px 16px 14px 20px;border-bottom:1px solid var(--hcf-line);background:var(--hcf-surface);color:var(--hcf-text)}
.hcf-dialog>header h2{margin:0}
.hcf-dialog-body{flex:1;min-height:0;overflow:auto}
.hcf-dialog>header p{margin:4px 0 0}
.hcf-dialog>footer{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0;padding:14px 20px;border-top:1px solid var(--hcf-line);background:var(--hcf-surface)}

/* Compact confirmation content: a clear outcome, followed by its recipient or destination. */
.hcf-confirmation{display:grid;justify-items:center;gap:1rem;padding:1.75rem 1.5rem;text-align:center;min-width:0}
.hcf-confirmation-icon{display:grid;place-items:center;width:3.25rem;height:3.25rem;border:1px solid var(--hcf-gold);border-radius:50%;background:var(--hcf-ivory);color:var(--hcf-text-meta)}
.hcf-confirmation-icon svg{width:1.5rem;height:1.5rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hcf-confirmation-copy{margin:0;color:var(--hcf-text-meta)}
.hcf-confirmation-recipient{display:grid;gap:.375rem;min-width:0;max-width:100%;margin:0;overflow-wrap:anywhere}
.hcf-confirmation-recipient>span{font-size:var(--hcf-text-small);color:var(--hcf-text-meta)}

/* Public intake uses flat surfaces and selectable cards for every choice group. */
.public-intake-page .standard-card { box-shadow: none; }
.public-intake-page .choice-list label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 12px;
    border: 1.5px solid var(--hcf-navy);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}
.public-intake-page .choice-list label:has(:checked) { background: #E8EEF5; }
.public-intake-page .choice-list label:has(:focus-visible) {
    outline: 3px solid var(--hcf-intake-focus);
    outline-offset: 3px;
}
.public-intake-page .choice-list label:has([aria-invalid=true]) {
    border-color: var(--hcf-intake-error);
}

/* Shared owner / Good Cause switch, also used by the public intake form. */
:is(.intake-page .switch, .hcf-switch){position:relative;display:inline-flex;align-items:center;width:46px;height:26px}
:is(.intake-page .switch, .hcf-switch) input[type=checkbox]{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;opacity:0;cursor:pointer}
:is(.intake-page .switch, .hcf-switch) span{width:46px;height:26px;border-radius:999px;background:var(--hcf-line-dark);transition:background .15s ease}
:is(.intake-page .switch, .hcf-switch) span::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .15s ease}
:is(.intake-page .switch, .hcf-switch) input:checked+span{background:var(--hcf-green)}
:is(.intake-page .switch, .hcf-switch) input:checked+span::after{transform:translateX(20px)}
.hcf-switch input:checked+span{background:var(--hcf-navy)}
.hcf-switch input:focus-visible+span{outline:2px solid var(--hcf-navy);outline-offset:3px}
