/* SingTuner app theme: the landing page's paper, navy ink and one action blue, applied to the app.
   Linked after the vendor theme (application.min.css + mask.css) in app/(app)/layout.tsx, so these rules win
   at equal specificity. CSS imported through Next (globals.css) loads *before* the vendor theme, which is why this
   file is a plain stylesheet. mask.css uses !important in places; the few rules below that need it say so.
   Colours were chosen for WCAG 2.2 AA (ratios in docs/design-review.md, "Tokens"). Light only, like the landing. */

:root {
    /* Surfaces */
    --paper: #f7f6f1;
    --surface: #ffffff;
    --surface-sunk: #efeee7;
    --line: #e3e2da;              /* decorative separators only, never a control boundary */
    --control-border: #8d8c83;    /* inputs, selects, outlined buttons: >= 3:1 on paper and white */

    /* Ink */
    --ink: #121529;
    --ink-soft: #555b73;
    --placeholder: #6b7083;

    /* Actions and focus */
    --action: #1a5fd6;            /* white text 5.75:1; as text 5.31:1 on paper */
    --action-hover: #154bb0;
    --action-tint: #eef3ff;
    --action-tint-border: #c9d8f7;
    --brand-blue: #2477ff;        /* large display text and illustrations only */
    --focus: #1a5fd6;

    /* Results */
    --ok: #1e7a45;
    --ok-graphic: #2e9e5b;
    --ok-tint: #e8f4ec;
    --ok-tint-border: #b9dcc5;
    --fair: #8a5a00;
    --fair-tint: #fff4d6;
    --fair-tint-border: #f0d78c;
    --poor: #b3261e;
    --poor-tint: #fdecea;
    --poor-tint-border: #f2b8b2;
    --premium: #f4c34f;           /* fill behind ink text only */

    /* Type, shape, depth */
    --font-ui: var(--font-body), "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
    --font-heading: var(--font-display), "Segoe UI", system-ui, sans-serif;
    --font-code: var(--font-mono), ui-monospace, Consolas, monospace;
    --radius-control: 8px;
    --radius-card: 12px;
    --shadow-float: 0 12px 28px -16px rgba(18, 21, 41, 0.45);

    /* The vendor theme's own tokens (mask.css), pointed at the palette above. */
    --gradient-color-top: var(--paper);
    --gradient-color-bottom: var(--paper);
    --title-font-color: var(--ink);
    --label-font-color: var(--ink);
    --label-font-color-dark: var(--ink);
    --label-font-color-light: var(--placeholder);
    --muted-font-color: var(--ink-soft);
    --nav-font-color: var(--ink);
    --widget-background-color: var(--surface);
    --widget-border-color: var(--line);
    --widget-controls-color: var(--ink);
    --button-default-color: var(--ink);
    --button-default-color-darker: var(--ink);
    --input-background-color: var(--surface);
    --input-focus-background-color: var(--surface);
    --input-font-color: var(--ink);
    --input-focus-font-color: var(--ink);
}

/* Ukrainian pages: the display and body fonts have no Cyrillic (and their size-matched fallbacks would take every
   Ukrainian letter first), so Inter sets the whole page, Latin words too (components/landing/fonts.ts). */
:root:lang(uk) {
    --font-display: var(--font-cyrillic);
    --font-body: var(--font-cyrillic);
}

/* ---- Base ---- */
html { font-size: 100%; } /* the vendor theme pins 14px; 100% follows the reader's browser setting (16px by default) */

body,
body.modal-open {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-ui);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.375rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1.0625rem; }
h6, .h6 { font-size: 1rem; }

small, .small { font-size: 0.875rem; font-weight: 400; }
b, strong, .fw-semi-bold, .fw-bold { font-weight: 700; }
.fw-thin { font-weight: 400; }

.text-muted { color: var(--ink-soft) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--poor) !important; }
.text-primary { color: var(--action) !important; }

/* ---- Links ---- */
a { color: var(--action); }
a:hover { color: var(--action-hover); }
/* Links inside running text are underlined (not told apart by colour alone); standalone links in lists and tables are not. */
main p a:not(.btn), .alert a:not(.btn), .form-text a, .breadcrumb a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

/* ---- Focus: one visible ring for every control (WCAG 2.4.7) ----
   !important so it beats the vendor `outline: 0` focus rules and inline `outline: none` (e.g. the editable staff). */
:focus-visible {
    outline: 3px solid var(--focus) !important;
    outline-offset: 2px !important;
}
.btn:focus, .btn.focus, .form-control:focus, .custom-select:focus, .page-link:focus { box-shadow: none; }

/* ---- Page header and breadcrumbs ---- */
.page-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink);
}
.page-title .fw-semi-bold, .page-title .fw-thin, .page-title b { font-weight: inherit; }
@media (min-width: 1024px) { .page-title { font-size: 2rem; } }

.breadcrumb { font-size: 0.875rem; color: var(--ink-soft); margin-bottom: 0.75rem; }
.breadcrumb > .active, .breadcrumb-item.active { color: var(--ink-soft); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--ink-soft); }

/* ---- Surfaces: widgets and cards are white on paper with a hairline, no gradients ---- */
.widget,
.card,
.modal .modal-content {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: none;
}
.widget { padding: 1.25rem; margin-bottom: 1.5rem; }
.widget-header h2, .widget-header h4, .card-header h2, .card-header h4 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.75rem; }
.card { margin-bottom: 1.5rem; }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 0.25rem; }
.card-body { padding: 1.25rem; }

/* ---- Buttons ---- */
.btn {
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25rem;
    padding: 0.5625rem 1rem;
    border-width: 1px;
    border-radius: var(--radius-control);
    box-shadow: none;
}
.btn-sm, .btn-group-sm > .btn { font-size: 0.875rem; line-height: 1.25rem; padding: 0.375rem 0.75rem; border-radius: var(--radius-control); }
.btn-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn:disabled, .btn.disabled { opacity: 0.5; }

.btn-primary,
.btn-primary:disabled, .btn-primary.disabled { color: #fff; background-color: var(--action); border-color: var(--action); }
.btn-primary:hover,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active { color: #fff; background-color: var(--action-hover); border-color: var(--action-hover); box-shadow: none; }

.btn-outline-dark,
.btn-default:not(.dropdown-toggle) { color: var(--ink) !important; background-color: var(--surface); border-color: var(--control-border); }
.btn-outline-dark:hover,
.btn-outline-dark:not(:disabled):not(.disabled):active,
.btn-outline-dark:not(:disabled):not(.disabled).active { color: var(--ink); background-color: var(--surface-sunk); border-color: var(--ink); box-shadow: none; }

.btn-dark,
.btn-dark:not(:disabled):not(.disabled):active { color: #fff; background-color: var(--ink); border-color: var(--ink); box-shadow: none; }

.btn-danger,
.btn-danger:disabled { color: #fff; background-color: var(--poor); border-color: var(--poor); }
.btn-danger:hover,
.btn-danger:not(:disabled):not(.disabled):active { color: #fff; background-color: #8f1e18; border-color: #8f1e18; box-shadow: none; }

.btn-outline-danger { color: var(--poor); background-color: var(--surface); border-color: var(--poor); }
.btn-outline-danger:hover,
.btn-outline-danger:not(:disabled):not(.disabled):active { color: #fff; background-color: var(--poor); border-color: var(--poor); box-shadow: none; }

.btn-warning,
.btn-warning:disabled { color: var(--ink); background-color: var(--premium); border-color: #d9a21b; }
.btn-warning:hover,
.btn-warning:not(:disabled):not(.disabled):active { color: var(--ink); background-color: #eab234; border-color: #c48f10; box-shadow: none; }

.btn-link { color: var(--action); font-weight: 400; }
.btn-link:hover { color: var(--action-hover); text-decoration: underline; }

/* ---- Forms: bordered white fields (field boundaries >= 3:1, WCAG 1.4.11) ---- */
.form-group > label,
.form-group > .d-flex > label,
.form-row label:not(.sr-only):not(.mb-0),
legend { font-weight: 700; color: var(--ink); margin-bottom: 0.375rem; }
.form-text { color: var(--ink-soft); font-size: 0.875rem; }

.form-control,
input[type=search],
input.search,
.custom-select {
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-control);
    box-shadow: none;
}
.custom-select { padding-right: 2rem; }
textarea.form-control {
    height: auto;
    color: var(--ink) !important;
    background-color: var(--surface) !important;
    border: 1px solid var(--control-border) !important;
}
.form-control-sm, .custom-select-sm, .input-group-sm > .form-control {
    height: 2.125rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.9375rem;
    border-radius: var(--radius-control);
}
.custom-select-sm { padding-right: 1.75rem; }
.table .custom-select-sm { min-width: 8.5rem; }
.form-control:focus,
.form-control:active,
textarea.form-control:focus,
input[type=text]:focus {
    color: var(--ink);
    background-color: var(--surface) !important;
    border-color: var(--action) !important;
}
.custom-select:focus { border-color: var(--action); }
.form-control::placeholder, input::placeholder, textarea::placeholder { color: var(--placeholder) !important; opacity: 1; }
.form-control:disabled, .form-control[readonly], .custom-select:disabled { background-color: var(--surface-sunk); color: var(--ink-soft); }
.form-control.is-invalid, .custom-select.is-invalid, textarea.form-control.is-invalid { border-color: var(--poor) !important; }
.invalid-feedback { color: var(--poor); font-size: 0.875rem; }

input[type=radio], input[type=checkbox] {
    accent-color: var(--action);
    width: 1.125rem;
    height: 1.125rem;
    vertical-align: -0.2em;
}
/* Segmented controls (globals.css) draw the choice on the label; the radio stays focusable but invisible. */
.segmented input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
fieldset > legend { font-size: 1rem; width: auto; }
input[type=file].form-control-file { font-size: 0.9375rem; }

/* ---- Tables ---- */
.table { color: var(--ink); }
.table th, .table td { border-top: 1px solid var(--line); padding: 0.75rem 0.625rem; }
.table-sm th, .table-sm td { padding: 0.5rem 0.5rem; }
.table thead th {
    border-bottom: 1px solid var(--control-border);
    font-family: var(--font-code);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.table-hover tbody tr:hover, .table-hover tbody tr:hover td { background-color: var(--paper) !important; }

/* ---- Badges ----
   Score and status badges keep their fills; text on every fill is >= 4.5:1.
   Role, plan and visibility use outlined chips (.badge-chip), so status colours stay reserved for results. */
.badge {
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 0.15em 0.5em;
    border: 1px solid transparent;
    border-radius: 6px;
    vertical-align: 0.1em;
}
span.badge.badge-success, a.badge.badge-success, .badge-success { color: #fff; background-color: var(--ok); }
span.badge.badge-danger, a.badge.badge-danger, .badge-danger { color: #fff; background-color: var(--poor); }
span.badge.badge-warning, a.badge.badge-warning, .badge-warning { color: var(--ink); background-color: var(--premium); border-color: #d9a21b; }
span.badge.badge-primary, a.badge.badge-primary, .badge-primary { color: #fff; background-color: var(--action); }
span.badge.badge-info, a.badge.badge-info, .badge-info { color: var(--action); background-color: var(--action-tint); border-color: var(--action-tint-border); }
span.badge.badge-secondary, a.badge.badge-secondary, .badge-secondary { color: var(--ink); background-color: var(--surface-sunk); border-color: var(--line); }
span.badge.badge-chip, .badge-chip { color: var(--ink); background-color: var(--surface); border-color: var(--control-border); font-weight: 700; }
span.badge.badge-chip-accent, .badge-chip-accent { color: var(--action); background-color: var(--action-tint); border-color: var(--action-tint-border); }
span.badge.badge-chip-premium, .badge-chip-premium { color: var(--ink); background-color: #fdf1cf; border-color: #d9a21b; }
/* The voices a sheet suits (quiet, several in a row), and "fits your range" in the result green. */
span.badge.badge-chip-voice, .badge-chip-voice { color: var(--ink-soft); background-color: var(--surface-sunk); border-color: var(--line); font-weight: 600; }
span.badge.badge-chip-fit, .badge-chip-fit { color: var(--ok); background-color: var(--ok-tint); border-color: var(--ok-tint-border); }
.voice-offer { padding: 1rem 1.25rem; }
.voice-offer-icon { font-size: 1.75rem; color: var(--action); line-height: 1; }
.voice-badges { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; vertical-align: 0.1em; }

/* ---- Alerts: pale tints with ink text instead of saturated fills ---- */
.alert {
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.875rem 1rem;
}
.alert-info { background: var(--action-tint); border-color: var(--action-tint-border); }
.alert-success { background: var(--ok-tint); border-color: var(--ok-tint-border); }
.alert-warning { background: var(--fair-tint); border-color: var(--fair-tint-border); }
.alert-danger { background: var(--poor-tint); border-color: var(--poor-tint-border); }
.alert h1, .alert h2, .alert h3, .alert h4, .alert h5 { color: var(--ink); }
.alert-link { color: var(--action); font-weight: 700; }
.permission-notice { color: var(--ink); }
/* The vendor theme makes every button in an alert a borderless, translucent white box (`.alert-info .btn:not(.btn-default)`
   and the other colours), which hides a primary button's white label. Buttons keep their own look in alerts (one more
   class than the vendor rules). */
.alert .btn.btn-primary:not(.btn-default) { background: var(--action); border: 1px solid var(--action); }
.alert .btn.btn-primary:not(.btn-default):hover { background: var(--action-hover); border-color: var(--action-hover); }
.alert .btn.btn-outline-dark:not(.btn-default) { background: var(--surface); border: 1px solid var(--control-border); }
.alert .btn.btn-link:not(.btn-default) { background: none; }

/* ---- Dropdown (user menu): an opaque white panel with ink text ---- */
.dropdown-menu,
.user-menu .dropdown-menu {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-float);
    padding: 0.5rem 0;
    min-width: 14rem;
    font-size: 0.9375rem;
}
.dropdown-menu .dropdown-item,
.user-menu .dropdown-menu .dropdown-item { color: var(--ink); padding: 0.5rem 1rem; font-size: 0.9375rem; }
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus { color: var(--ink); background-color: var(--surface-sunk); text-decoration: none; }
.dropdown-menu .dropdown-item-text,
.user-menu .dropdown-menu .dropdown-item-text { color: var(--ink-soft); padding: 0.25rem 1rem; font-size: 0.875rem; }
.dropdown-divider { border-top-color: var(--line); }

/* ---- Dialogs ---- */
.confirm-modal { background: rgba(18, 21, 41, 0.5); }
.modal .modal-content { box-shadow: var(--shadow-float); border-radius: 14px; }
.modal .modal-content .modal-header,
.modal .modal-content .modal-footer { border-color: var(--line); }
.modal-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 650; }
.share-legend { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; border-bottom: 0; } /* the vendor theme underlines legends */
.form-legend { font-size: 1rem; font-weight: 700; margin-bottom: 0.375rem; border-bottom: 0; }
.modal .close, .modal .modal-content .modal-body p { color: var(--ink); }
.modal .close { opacity: 0.8; text-shadow: none; }

/* ---- Lists, tabs, pagination ---- */
.list-group-item { color: var(--ink); background-color: var(--surface); border-color: var(--line); }
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link,
.nav-tabs > .nav-item > .nav-link { color: var(--ink-soft); border-radius: var(--radius-control) var(--radius-control) 0 0; }
.nav-tabs .nav-link:hover { color: var(--ink); border-color: transparent; text-decoration: none; }
.nav-tabs .nav-item .nav-link.active,
.nav-tabs > .nav-item .nav-link.active:focus,
.nav-tabs .nav-link.active {
    color: var(--ink);
    font-weight: 700;
    background-color: var(--surface);
    border-color: var(--line) var(--line) var(--surface);
}
.page-link { color: var(--action); background-color: var(--surface); border-color: var(--line); }
.page-link:hover { color: var(--action-hover); background-color: var(--surface-sunk); border-color: var(--line); }
.pagination .page-item.active .page-link { color: #fff; background-color: var(--action); border: 1px solid var(--action); }
.page-item.disabled .page-link { color: var(--ink-soft); background-color: var(--surface); }

/* ---- Shell: sidebar, top bar, logo ---- */
.sidebar { box-shadow: none; border-right: 1px solid var(--line); color: var(--ink); }
.sidebar-nav-title {
    margin: 1.5rem 0 0.25rem 1rem;
    font-family: var(--font-code);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
}
.sidebar-nav { padding: 0.25rem 0.5rem 0.25rem 0; font-weight: 400; }
.sidebar-nav > li { margin: 0; }
.sidebar-nav > li > a,
.sidebar-nav li a {
    color: var(--ink);
    font-size: 0.9375rem;
    line-height: 2.5rem;
    padding-left: 2.75rem;
    border-radius: var(--radius-control);
}
.sidebar-nav > li > a .icon { top: 0.375rem; left: 0; padding-left: 0.875rem; opacity: 0.85; color: var(--ink-soft); }
.sidebar-nav > li > a:hover { color: var(--ink); background-color: var(--surface-sunk); text-decoration: none; }
.sidebar-nav > .active > a,
.sidebar-nav > .active > a:hover {
    color: var(--ink);
    font-weight: 700;
    background-color: var(--action-tint);
    box-shadow: inset 3px 0 0 var(--action);
}
.sidebar-nav > .active > a .icon, .sidebar-nav > .active > a .icon .fi { color: var(--action); opacity: 1; }

.brand-logo { font-family: var(--font-heading); color: var(--ink); }
.brand-logo b { font-weight: 750; }
.brand-logo .fw-thin { font-weight: 450; }
.logo > a, .logo > a:hover { color: var(--ink); text-decoration: none; }

.app-topbar .btn-link,
.app-topbar .btn-link:hover,
.app-topbar-toggle,
.user-menu-toggle,
.notification-bell { color: var(--ink); }
.user-menu-toggle { font-weight: 700; }
.app-topbar .btn-link { padding: 0.5rem; }
@media (max-width: 767.98px) {
    .app-topbar { gap: 0.5rem; padding: 0 12px; }
}

/* Grid columns may shrink below their content, so wide tables scroll inside .table-responsive instead of
   widening the page (WCAG 1.4.10 reflow). */
.row > [class^="col"], .row > [class*=" col"] { min-width: 0; }
/* Contains absolutely positioned descendants (e.g. .sr-only header text), which otherwise widen the page. */
.table-responsive { position: relative; }
.notification-bell .badge { font-size: 0.6875rem; line-height: 1.1; padding: 0.15em 0.45em; }

/* ---- Trainer: the note to sing is the largest text on the page ---- */
.practice-target { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 500; margin-bottom: 0.25rem; }
.practice-target .fw-semi-bold { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---- Icons from the vendor icon font: quieter, inheriting colour ---- */
.empty-state-icon { color: var(--ink-soft); opacity: 1; }

/* ---- Spinner ---- */
.spinner-border { border-width: 0.2em; }

/* The contact links and EN · PT at the end of the sidebar. */
.sidebar-help { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; padding: 0 1.25rem; font-size: 0.8125rem; }
.sidebar-help a { color: inherit; opacity: 0.7; }
.sidebar-help a:hover { opacity: 1; }
.app-language { display: flex; gap: 0.4rem; padding: 0.5rem 1.25rem 1rem; font-size: 0.8125rem; }
.app-language a { color: inherit; opacity: 0.7; text-decoration: none; }
.app-language a[aria-current="page"] { font-weight: 700; opacity: 1; }
.app-language a:hover { opacity: 1; text-decoration: underline; }
