/* Loaded after css/bootstrap.min.css (see templates/element/head.php); there is no build step. */
:root {
    /* Palette follows the TENTEN customer portal (v2-domain.tenten.vn). */
    --brand: #1f5fad;
    --brand-dark: #194f91;
    --brand-ink: #174a87;
    --brand-soft: #ebf2fa;
    --ink: #1d2633;
    --muted: #5d6b7e;
    --line: #dde3ec;
    --field-line: #cdd4de;
    --surface: #ffffff;
    --page: #f2f4f7;
    --radius: 14px;
    --shadow: 0 1px 2px rgb(20 33 52 / 5%), 0 6px 20px rgb(20 33 52 / 5%);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--page);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 31, 95, 173;
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 31, 95, 173;
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-hover-color-rgb: 25, 79, 145;
    --bs-border-color: var(--line);
    --bs-border-radius: 10px;
    --bs-font-sans-serif: "Roboto", -apple-system, "Segoe UI", system-ui, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
}

body {
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

.icon {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
    vertical-align: -0.14em;
}

/* ---------- buttons ---------- */
.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn-sm {
    --bs-btn-border-radius: 8px;
    --bs-btn-padding-x: 0.7rem;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 4px 12px rgb(31 95 173 / 22%);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: #c3d5ec;
    --bs-btn-bg: var(--surface);
    --bs-btn-hover-bg: var(--brand-soft);
    --bs-btn-hover-color: var(--brand-dark);
    --bs-btn-hover-border-color: #9dbbe0;
    --bs-btn-active-bg: var(--brand-soft);
    --bs-btn-active-color: var(--brand-dark);
    --bs-btn-active-border-color: #9dbbe0;
}

.btn-outline-secondary {
    --bs-btn-color: #44506a;
    --bs-btn-border-color: var(--line);
    --bs-btn-bg: var(--surface);
    --bs-btn-hover-bg: #f1f4fa;
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-border-color: #cfd7e6;
    --bs-btn-active-bg: #e9eef7;
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-border-color: #cfd7e6;
}

.btn-outline-danger {
    --bs-btn-color: #c8324b;
    --bs-btn-border-color: #f3ccd3;
    --bs-btn-bg: var(--surface);
    --bs-btn-hover-bg: #fdecef;
    --bs-btn-hover-color: #a8233a;
    --bs-btn-hover-border-color: #eba9b5;
    --bs-btn-active-bg: #fdecef;
    --bs-btn-active-color: #a8233a;
    --bs-btn-active-border-color: #eba9b5;
}

.btn-icon {
    --bs-btn-padding-x: 0.45rem;
    --bs-btn-padding-y: 0.3rem;
    color: var(--muted);
    border: 0;
    background: transparent;
    border-radius: 8px;
}

.btn-icon:hover,
.btn-icon:focus-visible {
    color: var(--brand);
    background: var(--brand-soft);
}

.form-control,
.input-group-text {
    border-color: var(--field-line);
}

.form-control {
    background-color: var(--surface);
}

.form-control:focus {
    border-color: #8fb1dc;
    box-shadow: 0 0 0 0.2rem rgb(31 95 173 / 15%);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.alert {
    border: 0;
    border-radius: 10px;
}

/* Message boxes, same look as the TENTEN customer portal. */
.notice {
    --notice: var(--brand-ink);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 1rem;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--notice) 30%, transparent);
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--notice);
    font-size: 0.84rem;
    line-height: 1.5;
}

.notice > .icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    stroke-width: 2;
}

.notice .message {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.notice-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    margin: -2px -4px -2px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--notice);
    opacity: 0.7;
    transition: background-color 0.15s, opacity 0.15s;
}

.notice-close:hover,
.notice-close:focus-visible {
    background: color-mix(in srgb, var(--notice) 14%, transparent);
    opacity: 1;
}

.notice-close .icon {
    width: 0.85rem;
    height: 0.85rem;
    stroke-width: 2.2;
}

.notice.is-err {
    --notice: #b3362b;
    background: #fbecea;
}

.notice.is-ok {
    --notice: #1e7a4f;
    background: #e7f3ed;
}

.notice.is-info .message {
    color: var(--ink);
}

/* ---------- top bar ---------- */
.topbar {
    background: var(--brand);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 12px rgb(20 33 52 / 18%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 650;
    color: #fff;
    text-decoration: none;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    color: var(--brand);
    font-size: 1.15rem;
    background: #fff;
}

.topbar .btn-link {
    color: #fff;
}

.topbar .btn-topbar {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgb(255 255 255 / 45%);
    --bs-btn-bg: rgb(255 255 255 / 10%);
    --bs-btn-hover-color: var(--brand-dark);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-active-color: var(--brand-dark);
    --bs-btn-active-bg: #fff;
    --bs-btn-active-border-color: #fff;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.65rem 0.2rem 0.25rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 16%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: #fff;
    color: var(--brand-dark);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ---------- page frame + footer ---------- */
.app-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-page > main {
    flex: 1 0 auto;
}

.app-footer {
    flex: 0 0 auto;
    padding: 0.8rem 0 0.9rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--muted);
}

.app-footer p {
    margin: 0;
}

.app-footer p:first-child {
    font-weight: 500;
    color: #46566b;
}

/* ---------- panels ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.panel-head .btn-sm {
    --bs-btn-padding-x: 0.9rem;
    --bs-btn-padding-y: 0.4rem;
    --bs-btn-font-size: 0.9rem;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
}

.panel-title .icon {
    color: var(--brand);
    font-size: 1.15rem;
}

.count {
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: #eef1f7;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.panel-empty {
    padding: 2.25rem 1rem;
    margin: 0;
    text-align: center;
    color: var(--muted);
}

.hero {
    padding: 1.25rem;
    background:
        radial-gradient(60rem 14rem at 100% -40%, rgb(31 95 173 / 9%), transparent 60%),
        var(--surface);
}

.eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-domain {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 0.9rem;
    margin-top: 1.1rem;
}

.stat {
    padding: 1.05rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--brand-soft);
    border-color: #d3e0f1;
    min-width: 0;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
}

.stat-label .icon {
    color: var(--brand);
    font-size: 1.15rem;
}

.stat-value {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.stat-pair {
    display: inline-block;
    margin-right: 1rem;
    white-space: nowrap;
}

.stat-label {
    white-space: nowrap;
}

.stat-value small {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
}

.plan-badge {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 1.1rem;
    font-weight: 650;
}

.is-full {
    color: #c8324b;
}

/* <progress> is used so that no inline style is needed (CSP). */
.meter {
    display: block;
    width: 100%;
    height: 0.5rem;
    margin-top: 0.65rem;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #e6ebf5;
    appearance: none;
}

.meter::-webkit-progress-bar {
    background: #e6ebf5;
}

.meter::-webkit-progress-value {
    background: var(--brand);
    border-radius: 999px;
}

.meter::-moz-progress-bar {
    background: var(--brand);
}

.meter-full::-webkit-progress-value {
    background: #d9415a;
}

.meter-full::-moz-progress-bar {
    background: #d9415a;
}

.meter-sm {
    width: 7rem;
    height: 0.3rem;
    margin-top: 0.3rem;
}

/* ---------- tables ---------- */
.table-clean {
    --bs-table-bg: transparent;
    margin: 0;
}

.table-clean > thead th {
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-clean > tbody td {
    padding: 0.8rem 1.25rem;
    border-color: var(--line);
    vertical-align: middle;
}

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

.table-clean > tbody tr:hover td {
    background: #f6f9fd;
}

.cell-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 550;
}

.cell-main .avatar {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.cell-muted {
    color: var(--muted);
    font-size: 0.9rem;
}

/* A display name wraps after about ten characters, at a space when there is one. */
.cell-name {
    display: inline-block;
    max-width: 10ch;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* Icon-only row actions; the label shows as a tooltip on hover or focus. */
.btn-action {
    --bs-btn-padding-x: 0;
    --bs-btn-padding-y: 0;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: #44506a;
    font-size: 1.05rem;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-action:hover,
.btn-action:focus-visible {
    border-color: #9dbbe0;
    background: var(--brand-soft);
    color: var(--brand);
    transform: translateY(-1px);
}

.btn-action-sm {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 7px;
    font-size: 0.9rem;
    vertical-align: middle;
}

.btn-action-danger {
    color: #b3362b;
}

.btn-action-danger:hover,
.btn-action-danger:focus-visible {
    border-color: #eba9b5;
    background: #fbecea;
    color: #b3362b;
}

.tooltip {
    --bs-tooltip-bg: var(--ink);
    --bs-tooltip-border-radius: 7px;
    --bs-tooltip-padding-x: 0.6rem;
    --bs-tooltip-padding-y: 0.3rem;
    --bs-tooltip-font-size: 0.78rem;
    --bs-tooltip-opacity: 1;
    font-weight: 500;
}

.row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
}

.dns-table code,
.dns-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

/* ---------- modals / toasts ---------- */
.modal {
    --bs-modal-width: 31rem;
    backdrop-filter: blur(3px);
}

.modal-lg {
    --bs-modal-width: 50rem;
}

.modal-lg .modal-header {
    padding: 1.5rem 1.85rem 1.2rem;
}

.modal-lg .modal-body {
    padding: 1.6rem 1.85rem 1.75rem;
}

.modal-lg .modal-footer {
    padding: 1.1rem 1.85rem;
}

.modal-lg .modal-icon {
    width: 2.9rem;
    height: 2.9rem;
    font-size: 1.45rem;
}

.modal-lg .modal-title {
    font-size: 1.25rem;
}

.modal-backdrop {
    --bs-backdrop-bg: #14213a;
    --bs-backdrop-opacity: 0.45;
}

/* Entrance: the dialog rises and settles with a slight overshoot. */
.modal.fade .modal-dialog {
    opacity: 0;
    transform: translateY(1.25rem) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.25), opacity 0.2s ease-out;
}

.modal.show .modal-dialog {
    opacity: 1;
    transform: none;
}

.modal-content {
    --bs-modal-bg: var(--surface);
    position: relative;
    background: var(--surface);
    border: 0;
    border-radius: 18px;
    box-shadow: 0 30px 70px rgb(20 33 58 / 28%), 0 2px 6px rgb(20 33 58 / 10%);
    overflow: hidden;
}

/* Brand stripe along the top edge. */
.modal-content::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand), #6fb3e0);
    z-index: 2;
}

.modal-content.is-danger::before {
    background: linear-gradient(90deg, #8f2a21, #b3362b, #e58a7f);
}

.modal-header {
    gap: 0.85rem;
    padding: 1.35rem 1.5rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--brand-soft), var(--surface));
}

.is-danger .modal-header {
    background: linear-gradient(180deg, #fbecea, var(--surface));
}

.modal-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 6px 14px rgb(31 95 173 / 28%);
}

.is-danger .modal-icon {
    background: #b3362b;
    box-shadow: 0 6px 14px rgb(179 54 43 / 28%);
}

.modal.show .modal-icon {
    animation: icon-pop 0.45s 0.08s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.modal-header .btn-close {
    width: 2rem;
    height: 2rem;
    margin: 0 0 0 auto;
    padding: 0;
    border-radius: 50%;
    background-size: 0.7rem;
    opacity: 0.55;
    transition: background-color 0.15s, opacity 0.15s, transform 0.25s;
}

.modal-header .btn-close:hover,
.modal-header .btn-close:focus-visible {
    background-color: #e3ebf6;
    opacity: 1;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.35rem 1.5rem;
}

.modal-body .form-control,
.modal-body .input-group-text {
    min-height: 2.85rem;
    border-radius: 10px;
}

.modal-body .input-group > .form-control {
    border-radius: 10px 0 0 10px;
}

.modal-body .input-group > .input-group-text {
    border-radius: 0 10px 10px 0;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-weight: 500;
}

/* Two fields per row in large dialogs, one per row on phones. */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.25rem;
    align-items: start;
}

.form-grid .form-wide {
    grid-column: 1 / -1;
    margin: -0.5rem 0 0;
}

.form-grid .form-note {
    align-self: end;
    padding-bottom: 0.7rem;
}

.form-cell {
    min-width: 0;
}

.modal-body [data-target-label] {
    margin-bottom: 1.1rem;
}

.modal-body .form-control[readonly] {
    background: #f3f6fa;
    color: var(--muted);
    cursor: default;
}

.modal-body .form-text {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.modal-body .table {
    margin-bottom: 0;
    border-radius: 10px;
    overflow: hidden;
}

.modal-body .table > thead th {
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

[data-target-label] {
    display: inline-block;
    max-width: 100%;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.is-danger [data-target-label] {
    background: #fbecea;
    color: #b3362b;
}

.modal-footer {
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.modal-footer > * {
    margin: 0;
}

.modal-footer .btn {
    min-width: 6.5rem;
    min-height: 2.6rem;
}

.btn-danger {
    --bs-btn-bg: #b3362b;
    --bs-btn-border-color: #b3362b;
    --bs-btn-hover-bg: #982c23;
    --bs-btn-hover-border-color: #982c23;
    --bs-btn-active-bg: #982c23;
    --bs-btn-active-border-color: #982c23;
    --bs-btn-disabled-bg: #b3362b;
    --bs-btn-disabled-border-color: #b3362b;
    box-shadow: 0 4px 12px rgb(179 54 43 / 22%);
}

/* Busy state: a spinner while the request is running. */
.btn.is-busy {
    opacity: 0.85;
    cursor: progress;
}

.btn.is-busy::before,
.btn[data-submit]:disabled::before {
    content: "";
    width: 1rem;
    height: 1rem;
    border: 2px solid rgb(255 255 255 / 45%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Full-screen loading layer while a request runs: above dialogs and toasts, takes every click. */
.page-loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(15 23 42 / 35%);
    cursor: progress;
    animation: page-loading-in 0.15s ease-out;
}

.page-loading[hidden] {
    display: none;
}

.page-loading-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    background: #fff;
    color: #1e293b;
    font-weight: 500;
    box-shadow: 0 10px 30px rgb(15 23 42 / 25%);
}

.page-loading-spinner {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--brand-soft);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes page-loading-in {
    from {
        opacity: 0;
    }
}

/* The spinner takes the icon's place; on light buttons it uses the text colour. */
.btn.is-busy > .icon {
    display: none;
}

.btn[class*="btn-outline-"].is-busy::before {
    border-color: rgb(0 0 0 / 15%);
    border-top-color: currentcolor;
}

/* Errors slide in and give a short shake. */
[data-form-errors]:not(.d-none) {
    animation: shake 0.38s ease-in-out;
}

.member-list {
    max-height: 18rem;
    overflow-y: auto;
    border-radius: 10px;
}

.member-list .list-group-item {
    --bs-list-group-bg: var(--surface);
    background: var(--surface);
    transition: background-color 0.15s;
}

.member-list .list-group-item:has(input:checked) {
    background: var(--brand-soft);
}

.member-list label {
    cursor: pointer;
}

/* Notifications: top-right corner, just below the top bar. */
.toast-corner {
    margin-top: 3.75rem;
    z-index: 1095;
}

.note {
    /* Pale background per kind with text in the matching dark tone: green = done, amber = warning, red = error. */
    --note: #17683f;
    --note-bg: #e3f4ea;
    --note-line: #b5dfc6;
    --bs-toast-bg: var(--note-bg);
    --bs-toast-max-width: 23rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem 1rem;
    border: 1px solid var(--note-line);
    border-radius: 14px;
    background: var(--note-bg);
    color: var(--note);
    box-shadow: 0 14px 34px rgb(20 33 58 / 14%), 0 2px 6px rgb(20 33 58 / 6%);
    overflow: hidden;
}

.note-warn {
    --note: #7a4a00;
    --note-bg: #fff4d6;
    --note-line: #f1d48a;
}

.note-err {
    --note: #a32d23;
    --note-bg: #fde8e5;
    --note-line: #f2b8b1;
}

.note-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--note) 14%, transparent);
    color: var(--note);
}

.note-icon .icon {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-text {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.28rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.note-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: 0.1rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--note);
    opacity: 0.75;
    transition: background-color 0.15s, opacity 0.15s;
}

.note-close:hover,
.note-close:focus-visible {
    background: color-mix(in srgb, var(--note) 14%, transparent);
    opacity: 1;
}

.note-close .icon {
    width: 0.9rem;
    height: 0.9rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* Thin bar that runs down while the notification is on screen. */
.note-bar {
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: color-mix(in srgb, var(--note) 55%, transparent);
    transform-origin: left;
}

.note.show .note-bar {
    animation: note-countdown 5s linear forwards;
}

.toast.show {
    animation: toast-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes icon-pop {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-12deg);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

@keyframes note-countdown {
    to {
        transform: scaleX(0);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translate(1.5rem, -0.5rem);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- auth + error pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    background: var(--page);
    font-size: 0.875rem;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 35rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Soft decorative circles, as on the customer portal. */
.auth-card::before,
.auth-card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: var(--brand-soft);
    opacity: 0.6;
    pointer-events: none;
}

.auth-card::before {
    top: -9rem;
    right: -7rem;
    width: 17.5rem;
    height: 17.5rem;
}

.auth-card::after {
    bottom: 12rem;
    left: -5.5rem;
    width: 10rem;
    height: 10rem;
}

/* The same card used inside a logged-in page (change password). */
.auth-inline {
    margin: 1rem auto 2rem;
    font-size: 0.875rem;
}

.auth-inline::after {
    bottom: 2rem;
}

.auth-body {
    position: relative;
    z-index: 1;
    padding: 2.75rem 2.5rem 2rem;
}

.auth-brand {
    display: block;
    width: 174px;
    max-width: 70%;
    height: auto;
    margin: 0 auto 2.5rem;
}

.auth-eyebrow {
    margin: -1.1rem 0 1.6rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--brand);
}

.auth-title {
    margin: 0 0 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.field {
    position: relative;
    margin-bottom: 1rem;
}

.field > .icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: #7a8799;
    pointer-events: none;
    /* Stays above the wrapper that the show/hide button puts around password boxes. */
    z-index: 1;
}

.field > .form-control,
.field > .pw-wrap > .form-control {
    height: 3.125rem;
    padding-left: 3rem;
    border-radius: 10px;
    font-size: 0.875rem;
}

.field-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1rem;
}

.field-row .field {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.turnstile-box {
    min-height: 65px;
    margin-bottom: 1rem;
}

.captcha-image {
    flex: 0 0 auto;
    width: 150px;
    height: 3.125rem;
    object-fit: cover;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: #fff;
}

.captcha-refresh {
    flex: 0 0 auto;
    width: 3.125rem;
    height: 3.125rem;
    font-size: 1.1rem;
}

.btn-auth {
    width: 100%;
    height: 3.125rem;
    margin-top: 0.5rem;
    font-size: 0.94rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgb(31 95 173 / 22%);
}

.auth-links {
    margin: 1.25rem 0 0;
}

.auth-links a {
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.support-box {
    margin-top: 1.75rem;
    padding: 1rem 1.5rem;
    border: 1px solid #d3e0f1;
    border-radius: 14px;
    background: var(--brand-soft);
    font-size: 0.8125rem;
    color: #46566b;
}

.support-box dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1.25rem;
    margin: 0;
}

.support-box dt {
    font-weight: 400;
}

.support-box dt::before {
    content: "•";
    margin-right: 0.55rem;
    color: var(--brand);
}

.support-box dd {
    margin: 0;
}

.support-box strong {
    margin-right: 0.4rem;
    color: var(--ink);
}

.auth-lang {
    font-size: 0.8125rem;
}

/* ---------- language menu: one flag that opens the list ---------- */
.lang-switch {
    display: inline-block;
    vertical-align: middle;
}

.lang-flag {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    line-height: 0;
    transition: border-color 0.15s, background-color 0.15s;
}

.lang-flag:hover,
.lang-flag:focus-visible,
.lang-flag[aria-expanded="true"] {
    border-color: #9dbbe0;
    background: var(--brand-soft);
}

.lang-switch img {
    display: block;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgb(20 33 58 / 12%);
}

.lang-menu {
    --bs-dropdown-min-width: 10.5rem;
    --bs-dropdown-padding-y: 0.4rem;
    --bs-dropdown-border-color: var(--line);
    --bs-dropdown-border-radius: 12px;
    --bs-dropdown-link-color: var(--ink);
    --bs-dropdown-link-hover-bg: var(--brand-soft);
    --bs-dropdown-link-hover-color: var(--brand-ink);
    --bs-dropdown-link-active-bg: var(--brand-soft);
    --bs-dropdown-link-active-color: var(--brand-ink);
    --bs-dropdown-item-padding-x: 0.9rem;
    --bs-dropdown-item-padding-y: 0.5rem;
    --bs-dropdown-font-size: 0.9rem;
    box-shadow: 0 14px 34px rgb(20 33 58 / 16%), 0 2px 6px rgb(20 33 58 / 6%);
}

.lang-menu.show {
    animation: menu-in 0.16s ease-out;
}

.lang-menu .dropdown-item {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-weight: 500;
}

.lang-menu .dropdown-item.is-current {
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-weight: 600;
}

.error-card {
    max-width: 30rem;
    text-align: center;
}

.error-card .auth-brand {
    margin-bottom: 1.75rem;
}

.error-art {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 2.2rem;
}

/* Same colours as the error notice. */
.error-art.is-danger {
    background: #fbecea;
    color: #b3362b;
}

.token-invalid {
    margin-top: 0.5rem;
    text-align: center;
}

.token-invalid .error-title {
    color: #b3362b;
}

.token-invalid-text {
    text-align: center;
}

.error-code {
    margin: 0;
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--brand);
}

.error-title {
    margin: 0.75rem 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.error-text {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

@media (max-width: 575.98px) {
    .auth-body {
        padding: 2rem 1.25rem 1.5rem;
    }

    .support-box {
        padding: 0.9rem 1rem;
    }

    .support-box dl {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .support-box dd {
        margin: 0 0 0.4rem 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .captcha-image {
        width: 120px;
    }

    .panel-head,
    .hero {
        padding: 1rem;
    }

    .table-clean > thead th,
    .table-clean > tbody td {
        padding-inline: 1rem;
    }

    .error-code {
        font-size: 4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ---------- show / hide password ---------- */
.pw-wrap {
    position: relative;
    display: block;
}

.pw-wrap > .form-control {
    padding-right: 2.9rem;
}

/* The browser's own reveal button would duplicate ours. */
.pw-wrap > .form-control::-ms-reveal {
    display: none;
}

.pw-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7a8799;
    font-size: 1.1rem;
    transform: translateY(-50%);
    transition: background-color 0.15s, color 0.15s;
}

.pw-toggle:hover,
.pw-toggle:focus-visible,
.pw-toggle[aria-pressed="true"] {
    background: var(--brand-soft);
    color: var(--brand);
}

/* ---------- field errors from the browser-side checks ---------- */
.form-control.is-invalid,
.form-control.is-invalid:focus {
    border-color: #b3362b;
    background-image: none;
    padding-right: 0.75rem;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, #b3362b 18%, transparent);
}

.pw-wrap > .form-control.is-invalid {
    padding-right: 2.9rem;
}

.field-error {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-top: 0.35rem;
    color: #b3362b;
    font-size: 0.8rem;
    line-height: 1.4;
}

.field-error > .icon {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    stroke-width: 2;
}

/* Login-style fields keep their bottom gap; the message sits in it. */
.field + .field-error,
.field-row + .field-error {
    margin-top: -0.65rem;
    margin-bottom: 1rem;
}

.topbar .lang-flag {
    border-color: rgb(255 255 255 / 45%);
    background: rgb(255 255 255 / 12%);
    color: #fff;
}

.topbar .lang-flag:hover,
.topbar .lang-flag:focus-visible,
.topbar .lang-flag[aria-expanded="true"] {
    border-color: #fff;
    background: rgb(255 255 255 / 28%);
}

/* ---------- account menu in the header ---------- */
button.user-chip {
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s;
}

button.user-chip:hover,
button.user-chip:focus-visible,
button.user-chip[aria-expanded="true"] {
    background: rgb(255 255 255 / 28%);
}

.user-menu {
    --bs-dropdown-min-width: 13.5rem;
    --bs-dropdown-padding-y: 0.4rem;
    --bs-dropdown-border-color: var(--line);
    --bs-dropdown-border-radius: 12px;
    --bs-dropdown-link-color: var(--ink);
    --bs-dropdown-link-hover-bg: var(--brand-soft);
    --bs-dropdown-link-hover-color: var(--brand-ink);
    --bs-dropdown-link-active-bg: var(--brand-soft);
    --bs-dropdown-link-active-color: var(--brand-ink);
    --bs-dropdown-item-padding-x: 0.9rem;
    --bs-dropdown-item-padding-y: 0.55rem;
    --bs-dropdown-font-size: 0.9rem;
    box-shadow: 0 14px 34px rgb(20 33 58 / 16%), 0 2px 6px rgb(20 33 58 / 6%);
}

.user-menu.show {
    animation: menu-in 0.16s ease-out;
}

.user-menu .dropdown-item {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-weight: 500;
}

.user-menu .dropdown-item .icon {
    font-size: 1.05rem;
    color: #7a8799;
}

.user-menu .user-menu-danger,
.user-menu .user-menu-danger .icon {
    color: #b3362b;
}

.user-menu .user-menu-danger:hover,
.user-menu .user-menu-danger:focus-visible {
    background: #fbecea;
    color: #b3362b;
}

@keyframes menu-in {
    from {
        opacity: 0;
        translate: 0 -6px;
    }
}

/* ---------- service name and expiry in the overview panel ---------- */
.service-info {
    min-width: 0;
}

.service-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: center;
    margin: 0.45rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.service-meta strong {
    color: var(--ink);
    font-weight: 600;
}

.service-days {
    padding: 0.12rem 0.65rem;
    border-radius: 999px;
    background: #e7f3ed;
    color: #17683f;
    font-size: 0.82rem;
    font-weight: 600;
}

.service-days.is-critical {
    background: #fbecea;
    color: #b3362b;
}
