/* Общие стили NutriTrack.
   Вынесено из inline-блока <style> в Views/Shared/_Layout.cshtml. */

:root {
    --nt-primary: #4e73df;
    --nt-success: #1cc88a;
    --nt-warning: #f6c23e;
    --nt-danger: #e74a3b;
    --nt-info: #36b9cc;
    --nt-bg: #f8f9fc;
}

body {
    background-color: var(--nt-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

.navbar-brand i {
    color: var(--nt-success);
}

.nav-link {
    font-weight: 500;
}

.card {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    border-radius: 0.5rem;
}

.btn-primary {
    background-color: var(--nt-primary);
    border-color: var(--nt-primary);
}

.btn-primary:hover {
    background-color: #3a5bc7;
    border-color: #3a5bc7;
}

.btn-success {
    background-color: var(--nt-success);
    border-color: var(--nt-success);
}

.content-wrapper {
    min-height: calc(100vh - 120px);
}

footer {
    color: #858796;
    font-size: 0.85rem;
}

/* ───────────── Страницы входа и регистрации ───────────── */

.auth-card {
    max-width: 440px;
    margin: 60px auto;
}

.auth-card .card-body {
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h2 {
    font-weight: 700;
    color: #333;
}

.auth-header p {
    color: #858796;
}

/* ───────────── Индикатор отвалившегося CDN ───────────── */

.nt-cdn-warning {
    background: #fff3cd;
    color: #664d03;
    border-bottom: 1px solid #ffe69c;
    padding: .5rem 1rem;
    font-size: .875rem;
    text-align: center;
}

/* ───────────── Фигура с обхватами ───────────── */

.body-figure svg {
    display: block;
    margin: 0 auto;
}

/* Точки на контуре слегка проявляются при наведении — так понятнее,
   что это отметка уровня замера, а не украшение. */
.body-figure circle {
    transition: r .12s;
}

.body-figure:hover circle {
    r: 4;
}

/* Подписи в SVG наследуют шрифт страницы, иначе получится Times. */
.body-figure text {
    font-family: inherit;
}

/* ───────────── График веса ───────────── */

.weight-chart svg {
    display: block;
}

.weight-chart text {
    font-family: inherit;
}

/* ───────────── Сканер штрихкода ───────────── */

.barcode-reader {
    position: relative;
    width: 100%;
    min-height: 220px;
    background: #212529;
    border-radius: .5rem;
    overflow: hidden;
}

.barcode-reader video {
    display: block;
    width: 100%;
}

/* Рамка показывает полосу, которую разбирает движок: код надо навести
   именно туда, иначе он в анализ не попадёт. */
.barcode-frame {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 32.5%;
    height: 35%;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: .35rem;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
    pointer-events: none;
}

.barcode-torch {
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    background: rgba(255, 255, 255, .9);
}

.barcode-torch.active {
    background: #ffc107;
    border-color: #ffc107;
}

/* ───────────── Редактор состава рецепта ───────────── */

.ing-results {
    display: none;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: .75rem;
}

/* Кнопка, а не div с обработчиком: так работает клавиатура
   и корректно читают программы озвучивания. */
.ing-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .5rem .75rem;
    border: 0;
    border-bottom: 1px solid #f1f3f9;
    background: #fff;
    text-align: left;
}

.ing-option:last-child {
    border-bottom: 0;
}

.ing-option:hover:not([disabled]),
.ing-option:focus-visible {
    background: #f1f6ff;
}

.ing-option[disabled] {
    opacity: .5;
}

.ing-row {
    padding: .5rem .25rem;
    border-bottom: 1px solid #f1f3f9;
}

.ing-row:last-child {
    border-bottom: 0;
}

.ing-weight {
    position: relative;
    flex-shrink: 0;
    width: 6.5rem;
}

.ing-weight input {
    text-align: center;
    padding-right: 1.6rem;
}

.ing-unit {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    color: #adb5bd;
    pointer-events: none;
}

/* Кнопка отправки на время перехода: показываем, что нажатие принято,
   иначе непонятно, почему она перестала отвечать. */
.nt-submitting {
    opacity: .65;
    cursor: progress;
}

/* Собственный значок выравниваем по строке так же, как значки набора. */
.wk-icon {
    vertical-align: -0.125em;
}
