/* /public/assets/css/global.css */

html {
    background: var(--page-background);
    color: var(--text-primary);
    font-family: var(--font-body);
}

body {
    background: var(--page-background);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--line-normal);
}

body.is-scroll-locked {
    overflow: hidden;
}

::selection {
    background: rgba(240, 200, 8, 0.72);
    color: var(--ink-950);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--line-snug);
    text-wrap: balance;
}

h1 { font-size: clamp(2rem, 4.5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.65rem, 3vw, var(--text-4xl)); }
h3 { font-size: clamp(1.25rem, 2vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p,
li,
dd {
    color: var(--text-secondary);
}

p + p {
    margin-top: var(--space-4);
}

strong,
b {
    color: var(--text-primary);
    font-weight: 700;
}

small {
    font-size: var(--text-sm);
}

code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
}

code {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--surface-muted);
    padding: 0.12em 0.35em;
    font-size: 0.9em;
}

pre {
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-inverse);
    color: var(--text-inverse);
    padding: var(--space-5);
    line-height: 1.6;
}

hr {
    height: 1px;
    margin: var(--space-8) 0;
    border: 0;
    background: var(--border);
}

button,
a,
input,
select,
textarea,
[tabindex] {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
    color: var(--text-link-hover);
}

.container {
    width: min(calc(100% - (2 * var(--content-gutter))), var(--container-width));
    margin-inline: auto;
}

.container--wide {
    width: min(calc(100% - (2 * var(--content-gutter))), var(--container-wide));
    margin-inline: auto;
}

.section {
    padding-block: clamp(var(--space-16), 8vw, var(--space-28));
}

.section--compact {
    padding-block: clamp(var(--space-10), 5vw, var(--space-16));
}

.section--surface {
    background: var(--surface);
}

.section--warm {
    background: var(--page-background-warm);
}

.section--dark {
    background: var(--ink-950);
    color: var(--white);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
    color: var(--white);
}

.section-heading {
    max-width: 720px;
    margin-bottom: clamp(var(--space-8), 4vw, var(--space-12));
}

.section-heading--center {
    margin-inline: auto;
    text-align: center;
}

.section-heading p {
    max-width: 650px;
    margin-top: var(--space-4);
    font-size: var(--text-lg);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    color: var(--cerulean);
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0.09em;
    line-height: 1;
    text-transform: uppercase;
}

.eyebrow--light {
    color: var(--bright-amber);
}

.lead {
    color: var(--text-secondary);
    font-size: clamp(var(--text-lg), 2vw, var(--text-xl));
    line-height: 1.7;
}

.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-centre,
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-nowrap { white-space: nowrap; }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: var(--space-3);
    left: var(--space-3);
    z-index: var(--z-loader);
    transform: translateY(-180%);
    border-radius: var(--radius-md);
    background: var(--bright-amber);
    color: var(--ink-950);
    padding: var(--space-3) var(--space-5);
    font-weight: 800;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    transform: translateY(0);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--ink-950);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink-950);
}

.brand__mark {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--turquoise-surf), var(--cerulean));
    color: var(--white);
    font-size: 1.55rem;
    box-shadow: 0 10px 22px rgba(6, 174, 213, 0.28);
    transform: rotate(-3deg);
}

.brand__wordmark {
    color: currentColor;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
}

.brand__wordmark span {
    color: var(--turquoise-surf);
}

.brand--compact .brand__mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
    font-size: 1.3rem;
}

.brand--compact .brand__wordmark {
    font-size: 1.35rem;
}

.brand--inverse {
    color: var(--white);
}

.brand--inverse:hover {
    color: var(--white);
}

.brand--footer .brand__mark {
    box-shadow: none;
}

.button,
button.button,
input[type="submit"].button {
    position: relative;
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 750;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition:
        transform var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-normal) var(--ease-standard),
        background-color var(--duration-normal) var(--ease-standard),
        border-color var(--duration-normal) var(--ease-standard),
        color var(--duration-normal) var(--ease-standard);
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:active:not(:disabled) {
    transform: translateY(0);
}

.button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.button--primary {
    background: linear-gradient(135deg, var(--turquoise-surf), #0499be);
    color: var(--ink-950);
    box-shadow: 0 10px 25px rgba(6, 174, 213, 0.25);
}

.button--primary:hover {
    background: linear-gradient(135deg, #22bce0, var(--turquoise-surf));
    color: var(--ink-950);
    box-shadow: var(--shadow-brand);
}

.button--secondary {
    border-color: rgba(8, 103, 136, 0.25);
    background: rgba(6, 174, 213, 0.09);
    color: var(--cerulean);
}

.button--secondary:hover {
    border-color: var(--turquoise-surf);
    background: rgba(6, 174, 213, 0.16);
    color: var(--cerulean);
}

.button--ghost {
    border-color: var(--border);
    background: transparent;
    color: var(--text-primary);
}

.button--ghost:hover {
    border-color: var(--border-strong);
    background: var(--surface-muted);
    color: var(--text-primary);
}

.button--danger {
    background: var(--danger);
    color: var(--white);
    box-shadow: var(--shadow-danger);
}

.button--danger:hover {
    background: var(--danger-strong);
    color: var(--white);
}

.button--amber {
    background: var(--bright-amber);
    color: var(--ink-950);
    box-shadow: 0 10px 24px rgba(240, 200, 8, 0.28);
}

.button--small {
    min-height: 38px;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.9rem;
    font-size: var(--text-xs);
}

.button--large {
    min-height: 56px;
    padding-inline: 1.65rem;
    font-size: var(--text-base);
}

.button--block {
    width: 100%;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition:
        background-color var(--duration-fast) var(--ease-standard),
        color var(--duration-fast) var(--ease-standard),
        border-color var(--duration-fast) var(--ease-standard);
}

.icon-button:hover {
    border-color: var(--border);
    background: var(--surface-muted);
    color: var(--text-primary);
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card--flat {
    box-shadow: none;
}

.card--interactive {
    transition:
        transform var(--duration-normal) var(--ease-standard),
        box-shadow var(--duration-normal) var(--ease-standard),
        border-color var(--duration-normal) var(--ease-standard);
}

.card--interactive:hover {
    transform: translateY(-3px);
    border-color: rgba(6, 174, 213, 0.45);
    box-shadow: var(--shadow-md);
}

.card__header,
.card__body,
.card__footer {
    padding: var(--space-6);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    border-bottom: 1px solid var(--border-soft);
}

.card__footer {
    border-top: 1px solid var(--border-soft);
}

.grid {
    display: grid;
    gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-label,
label {
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 700;
}

.form-label__optional {
    color: var(--text-muted);
    font-weight: 500;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.72rem 0.9rem;
    box-shadow: var(--shadow-xs);
    transition:
        border-color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-fast) var(--ease-standard),
        background-color var(--duration-fast) var(--ease-standard);
}

textarea {
    min-height: 125px;
}

.form-control:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: var(--ink-400);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--turquoise-surf);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

.form-control[aria-invalid="true"],
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(221, 28, 26, 0.12) !important;
}

.form-help,
.form-hint {
    color: var(--text-muted);
    font-size: var(--text-xs);
    line-height: 1.55;
}

.form-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    color: var(--danger);
    font-size: var(--text-xs);
    font-weight: 600;
}

.input-wrap {
    position: relative;
}

.input-wrap > i:first-child {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrap > i:first-child + input {
    padding-left: 2.65rem;
}

.input-wrap > input {
    width: 100%;
    padding-right: 3.5rem;
}

.input-action {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    z-index: 2;
    display: inline-grid;
    width: 40px;
    min-height: 40px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    padding: 0;
    font-size: 1.2rem;
    cursor: pointer;
}

.input-action:hover {
    background: var(--surface-muted);
    color: var(--cerulean);
}

.input-action:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 1px;
}

.checkbox,
.radio {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
}

.checkbox input,
.radio input {
    width: 1.1rem;
    height: 1.1rem;
    min-height: auto;
    flex: 0 0 auto;
    margin-top: 0.15rem;
    accent-color: var(--turquoise-surf);
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch__track {
    position: relative;
    width: 46px;
    height: 26px;
    flex: 0 0 46px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--ink-300);
    transition: background var(--duration-normal) var(--ease-standard);
}

.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration-normal) var(--ease-standard);
}

.switch input:checked + .switch__track {
    border-color: var(--turquoise-surf);
    background: var(--turquoise-surf);
}

.switch input:checked + .switch__track::after {
    transform: translateX(20px);
}

.switch input:focus-visible + .switch__track {
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.badge {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    gap: var(--space-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-muted);
    color: var(--text-secondary);
    padding: 0.25rem 0.65rem;
    font-size: var(--text-xs);
    font-weight: 700;
}

.badge--success { border-color: rgba(17, 137, 99, 0.28); background: var(--success-soft); color: var(--success-strong); }
.badge--warning { border-color: rgba(168, 110, 0, 0.26); background: var(--warning-soft); color: var(--warning-strong); }
.badge--danger { border-color: rgba(221, 28, 26, 0.28); background: var(--danger-soft); color: var(--danger); }
.badge--info { border-color: rgba(6, 174, 213, 0.28); background: var(--info-soft); color: var(--cerulean); }
.badge--dark { border-color: transparent; background: var(--ink-950); color: var(--white); }

.avatar {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 2px solid rgba(6, 174, 213, 0.25);
    border-radius: 50%;
    background: linear-gradient(145deg, var(--cerulean), var(--turquoise-surf));
    color: var(--white);
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.avatar--small {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: var(--text-xs);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.data-table {
    width: 100%;
    min-width: 680px;
}

.data-table th,
.data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.data-table tbody tr {
    transition: background-color var(--duration-fast) var(--ease-standard);
}

.data-table tbody tr:hover {
    background: var(--surface-subtle);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.pagination__links {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pagination__link {
    display: grid;
    min-width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
}

.pagination__link.is-active {
    border-color: var(--turquoise-surf);
    background: var(--turquoise-surf);
    color: var(--ink-950);
}

.divider-label {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
}

.divider-label::before,
.divider-label::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.alert > i {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    font-size: 1.2rem;
}

.alert--info { border-color: rgba(6,174,213,.28); background: var(--info-soft); }
.alert--success { border-color: rgba(17,137,99,.28); background: var(--success-soft); }
.alert--warning { border-color: rgba(168,110,0,.28); background: var(--warning-soft); }
.alert--danger { border-color: rgba(221,28,26,.28); background: var(--danger-soft); }

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ink-400);
}

.status-dot--success { background: var(--success); box-shadow: 0 0 0 4px rgba(17,137,99,.13); }
.status-dot--warning { background: var(--bright-amber); box-shadow: 0 0 0 4px rgba(240,200,8,.15); }
.status-dot--danger { background: var(--danger); box-shadow: 0 0 0 4px rgba(221,28,26,.13); }

[aria-busy="true"] {
    cursor: progress;
}


/*
 * Exposes the account identifier to password managers without presenting it
 * as an editable field in authentication or account-security forms.
 */
.password-manager-username {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
