/* Reusable controls - buttons, inputs, cards, notification bar. Colours from Tokens.css only. */

.Button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font: 600 15px var(--font);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.Button:hover { background: var(--surface-3); }
.Button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.Button:disabled { opacity: 0.5; cursor: default; }

.Button.Primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}

.Button.Primary:hover { filter: brightness(1.08); }

.Button.Danger {
    color: var(--danger);
}

.Button.Large {
    min-height: 56px;
    padding: 0 28px;
    font-size: 18px;
}

.Button.Icon {
    width: 44px;
    padding: 0;
}

.Button.Small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

.Button.Icon.Small {
    width: 36px;
    padding: 0;
}

.Button.Block { width: 100%; }

.Button.Chip {
    min-height: 36px;
    min-width: 40px;
    padding: 0 10px;
    font-size: 14px;
}

.Button.Toggled {
    border-color: var(--accent);
    color: var(--accent);
}

/* Switched on but not audible yet - the browser needs a tap first. Filled, so it's noticed. */
.Button.NeedsTap {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-text);
}

a.Button { text-decoration: none; }

.Field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.Field label,
.Field .FieldLabel {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.Input,
.TextArea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: 16px var(--font); /* 16px stops iOS zooming into the field */
}

.TextArea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.5;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

.Input.Compact {
    min-height: 36px;
    padding: 6px 10px;
}

.Input:disabled { opacity: 0.75; }

.Input:focus,
.TextArea:focus {
    outline: 2px solid var(--focus);
    outline-offset: -1px;
}

.Card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.Muted { color: var(--text-muted); }
.ErrorText { color: var(--danger); font-size: 14px; }

#NotificationBar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 50;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: var(--radius);
    background: var(--surface-3);
    color: var(--text);
    box-shadow: var(--shadow);
    transform: translateX(-50%);
    display: none;
}

#NotificationBar.Error { background: var(--danger); color: #fff; }
