/* ============================================================
   NEXTGEN ALYGN - PATTERN COMPONENT STYLES (Phase 5)
   Forms · feedback · navigation. Token-driven, WCAG 2.2 AA.
   Prefix .ngx-. Loaded after components.css.
   ============================================================ */

/* ---------------- LINK ---------------- */
.ngx-link { color: var(--text-accent); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; font-weight: var(--weight-medium); border-radius: 2px; }
.ngx-link:hover { text-decoration-thickness: 2px; }
.ngx-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.ngx-link--standalone { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: var(--weight-bold); letter-spacing: var(--tracking-wide); text-transform: uppercase; font-size: var(--text-body-sm); }
.ngx-link--standalone:hover { text-decoration: none; }
.ngx-link--standalone .ngx-link__arrow { transition: transform var(--duration) var(--ease-out); }
.ngx-link--standalone:hover .ngx-link__arrow { transform: translateX(3px); }
.ngx-link--quiet { color: var(--text-secondary); text-decoration: none; }
.ngx-link--quiet:hover { color: var(--text-primary); text-decoration: underline; }

/* ---------------- FIELD / INPUT / SELECT ---------------- */
.ngx-field { display: flex; flex-direction: column; gap: 8px; }
.ngx-label { font-size: var(--text-body-sm); font-weight: var(--weight-medium); color: var(--text-primary); }
.ngx-label__req { color: var(--danger); margin-left: 3px; }
.ngx-label__opt { color: var(--text-muted-accessible); font-weight: var(--weight-regular); margin-left: 6px; font-size: var(--text-caption); }
.ngx-hint { font-size: var(--text-body-sm); color: var(--text-muted-accessible); line-height: 1.45; }
.ngx-control { position: relative; display: flex; }
.ngx-input, .ngx-select { width: 100%; box-sizing: border-box; font-family: var(--font-sans); font-size: 16px; line-height: 1.4; color: var(--text-primary); background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 11px 14px; min-height: 44px; transition: border-color var(--duration) var(--ease-standard), box-shadow var(--duration) var(--ease-standard); }
.ngx-input::placeholder { color: var(--text-muted); }
.ngx-input:hover, .ngx-select:hover { border-color: var(--border-strong); }
.ngx-input:focus-visible, .ngx-select:focus-visible { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 32%, transparent); }
.ngx-input:disabled, .ngx-select:disabled { opacity: 0.5; cursor: not-allowed; background: var(--surface-sunken); }
.ngx-select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.ngx-select__chevron { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-secondary); }
.ngx-field--error .ngx-input, .ngx-field--error .ngx-select { border-color: var(--danger); }
.ngx-field--error .ngx-input:focus-visible, .ngx-field--error .ngx-select:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 30%, transparent); }
.ngx-error { display: flex; align-items: flex-start; gap: 7px; font-size: var(--text-body-sm); font-weight: var(--weight-medium); color: var(--danger); line-height: 1.4; }
.ngx-error .ngx-icon { margin-top: 1px; flex: none; }

/* ---------------- CHECKBOX / CONSENT ---------------- */
.ngx-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.ngx-check__box { position: relative; flex: none; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface-card); transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); }
.ngx-check__native { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; top: 0; left: 0; cursor: pointer; }
.ngx-check__tick { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.ngx-check__native:checked ~ .ngx-check__box { background: var(--accent-action); border-color: var(--accent-action); }
.ngx-check__native:checked ~ .ngx-check__box .ngx-check__tick { opacity: 1; transform: scale(1); }
.ngx-check__native:focus-visible ~ .ngx-check__box { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ngx-check__native:disabled ~ .ngx-check__box { opacity: 0.5; }
.ngx-check__label { font-size: var(--text-body-sm); line-height: 1.5; color: var(--text-secondary); }
.ngx-check__label a { color: var(--text-accent); }
.ngx-check--consent { padding: 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-card); }

/* ---------------- ALERT / STATUS ---------------- */
.ngx-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: var(--text-body-sm); line-height: 1.5; }
.ngx-alert__icon { flex: none; margin-top: 1px; }
.ngx-alert__body { flex: 1; }
.ngx-alert__title { font-weight: var(--weight-bold); margin-bottom: 2px; color: var(--text-primary); }
.ngx-alert__text { color: var(--text-secondary); }
.ngx-alert--info { background: var(--info-surface); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.ngx-alert--info .ngx-alert__icon { color: var(--info); }
.ngx-alert--success { background: var(--success-surface); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.ngx-alert--success .ngx-alert__icon { color: var(--success); }
.ngx-alert--warning { background: var(--warning-surface); border-color: color-mix(in srgb, var(--warning) 34%, transparent); }
.ngx-alert--warning .ngx-alert__icon { color: var(--warning); }
.ngx-alert--error { background: var(--danger-surface); border-color: color-mix(in srgb, var(--danger) 34%, transparent); }
.ngx-alert--error .ngx-alert__icon { color: var(--danger); }

/* ---------------- ACCORDION ---------------- */
.ngx-accordion { border-top: 1px solid var(--border-subtle); }
.ngx-accordion__item { border-bottom: 1px solid var(--border-subtle); }
.ngx-accordion__trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: none; border: 0; cursor: pointer; padding: 20px 4px; text-align: left; font-family: var(--font-sans); font-size: var(--text-h4); font-weight: var(--weight-medium); letter-spacing: var(--tracking-tight); color: var(--text-primary); min-height: 44px; }
.ngx-accordion__trigger:hover { color: var(--text-accent); }
.ngx-accordion__trigger:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 2px; }
.ngx-accordion__icon { flex: none; color: var(--text-accent); transition: transform var(--duration) var(--ease-out); }
.ngx-accordion__trigger[aria-expanded="true"] .ngx-accordion__icon { transform: rotate(45deg); }
.ngx-accordion__panel { overflow: hidden; }
.ngx-accordion__panel-inner { padding: 0 4px 22px; font-size: var(--text-body); line-height: var(--leading-relaxed); color: var(--text-secondary); max-width: 60ch; }
@media (prefers-reduced-motion: no-preference) { .ngx-accordion__icon { transition: transform var(--duration) var(--ease-out); } }
