/*
 * Мини-дизайн-система личного кабинета.
 * Токены + общие элементы (кнопки, пилюли, карточки, формы).
 * Стили бонусной карты и плиток заказов — в profile_card.css.
 */

:root {
    /* Кабинет всегда светлый: без этого на телефонах в тёмной теме
       telegram-виджет (iframe наследует схему) рисует чёрную подложку,
       а браузеры с авто-тёмным режимом перекрашивают страницу */
    color-scheme: light;

    --cab-green: #458f03;
    --cab-green-dark: #387503;
    --cab-green-soft: #eef5e4;
    --cab-yellow: #f8bd05;
    --cab-ink: #333;
    --cab-muted: #777;
    --cab-faint: #a9a49b;
    --cab-line: #eceae5;
    --cab-radius: 14px;
    --cab-shadow: 0 1px 4px rgba(60, 50, 30, .06);
}

body {
    font-family: 'Ubuntu', sans-serif;
    color: var(--cab-ink);
}

/* Футер сайта — только на десктопе (на мобильном ЛК решили без него);
   прижат к низу и на коротких страницах, иначе под серым .main
   остаётся голое белое body */
@media (max-width: 778.98px) {
    .main-footer {
        display: none;
    }
}

@media (min-width: 779px) {
    .main {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .main-footer {
        margin-top: auto;
    }
}

/* Иконки соцсетей в футере свёрстаны под content-box (25px + padding),
   bootstrap кабинета делает всем border-box — svg вылезал из подложки */
.main-footer .svg-icon {
    box-sizing: content-box;
}

/* Подпись-капшен над блоком (как у списка заказов) */
.cab-caption {
    font-size: .78em;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cab-faint);
    margin: 0 2px 8px;
    text-align: left;
}

/* ----- заголовок страницы под шапкой ----- */

.cab-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 22px;
}

.cab-title {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0;
    color: var(--cab-ink);
}

/* Пилюля статуса (как в списке заказов) */
.cab-pill {
    flex-shrink: 0;
    font-size: .78em;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--cab-green-soft);
    color: var(--cab-green);
    white-space: nowrap;
}

.cab-pill--done {
    background: #f2f1ee;
    color: #999;
}

/* ----- белая карточка ----- */

.cab-card {
    background: #fff;
    border: 1px solid var(--cab-line);
    border-radius: var(--cab-radius);
    box-shadow: var(--cab-shadow);
    padding: 18px 16px;
}

/* ----- сегмент-контрол мобильных табов (как modify-wrap на сайте) ----- */

.cab-tabs {
    display: flex;
    background: #eee;
    border-radius: 15px;
    padding: 3px;
}

.cab-tab {
    flex: 1;
    text-align: center;
    padding: 8px 5px;
    border-radius: 12px;
    color: #757575;
    cursor: pointer;
    user-select: none;
    transition: all .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.cab-tab.select {
    background: #fff;
    color: var(--cab-green);
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

/* ----- кнопки ----- */

.cab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    background: var(--cab-green);
    color: #fff;
    font: inherit;
    padding: 10px 24px;
    cursor: pointer;
    transition: background .15s ease;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cab-btn:hover,
.cab-btn:active {
    background: var(--cab-green-dark);
    color: #fff;
    text-decoration: none;
}

.cab-btn--ghost {
    background: transparent;
    color: var(--cab-muted);
}

.cab-btn--ghost:hover,
.cab-btn--ghost:active {
    background: #f2f1ee;
    color: var(--cab-ink);
}

.cab-btn--block {
    width: 100%;
}

/* ----- форма настроек в карточке ----- */

.cab-card label {
    font-size: .85em;
    color: var(--cab-muted);
    margin-bottom: .25rem;
}

.cab-card .form-control {
    border: 1px solid #e2dfd8;
    border-radius: 10px;
}

.cab-card .form-control[readonly] {
    background: #f6f5f2;
    color: var(--cab-muted);
}

.cab-logout {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: .85em;
    color: #b34a3f;
}

.cab-logout:hover {
    color: #8f2f26;
}

/* ----- фокус: вместо глушения box-shadow — видимый зелёный ----- */

.form-control:focus,
.cab-card .form-control:focus {
    border-color: var(--cab-green);
    box-shadow: 0 0 0 3px rgba(69, 143, 3, .15);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(69, 143, 3, .15);
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--cab-green);
    outline-offset: 2px;
}

/* Переключатель «Другой адрес» — зелёный вместо бутстраповского синего */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--cab-green);
    border-color: var(--cab-green);
}

/* ----- фидбек после «Сохранить» ----- */

.cab-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cab-green-soft);
    color: var(--cab-green);
    border: 1px solid #dcead0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    animation: cab-toast-in .35s ease;
}

.cab-toast svg {
    flex-shrink: 0;
}

@keyframes cab-toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

/* ----- лоадер telegram-виджета на signin ----- */

.tg-auth {
    position: relative;
    min-height: 46px;
}

.tg-auth .tg-spinner {
    position: absolute;
    left: 50%;
    top: 6px;
    margin-left: -14px;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(69, 143, 3, .25);
    border-top-color: var(--cab-green);
    border-radius: 50%;
    animation: cab-spin .8s linear infinite;
}

.tg-auth.is-ready .tg-spinner {
    display: none;
}

.tg-auth .tg-fallback {
    display: none;
}

.tg-auth.is-slow .tg-fallback {
    display: block;
}

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

.signin-card {
    margin-top: 6vh;
    padding: 28px 22px 22px;
}

.signin-logo {
    height: 64px;
    margin-bottom: 14px;
}

.signin-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 8px;
}

.signin-sub {
    font-size: .9em;
    color: var(--cab-muted);
    margin-bottom: 18px;
}

.signin-note {
    font-size: .8em;
    color: var(--cab-faint);
    margin: 14px 0 0;
}

.signin-copy {
    text-align: center;
    font-size: .8em;
    color: var(--cab-faint);
    margin-top: 14px;
}

.tg-auth .tg-fallback {
    color: var(--cab-muted);
}

/* ----- трекер: шаги статуса ----- */

.track-card {
    padding: 8px 16px;
}

.track-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    position: relative;
}

.track-step__icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cab-green);
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* соединительная линия к предыдущему шагу */
.track-step + .track-step::before {
    content: '';
    position: absolute;
    left: 17.5px;
    top: -14px;
    height: 28px;
    width: 3px;
    background: var(--cab-green);
    border-radius: 2px;
}

.track-step--pending .track-step__icon {
    background: #f2f1ee;
    color: #b9b4ac;
}

.track-step--pending::before {
    background: #f2f1ee;
}

.track-step__text {
    line-height: 1.35;
    font-weight: bold;
}

.track-step__text small {
    display: block;
    font-weight: normal;
    font-size: .82em;
    color: var(--cab-muted);
}

.track-step--pending .track-step__text {
    color: var(--cab-faint);
}

.track-step--pending .track-step__text small {
    color: var(--cab-faint);
}

.metroicon-done::before {
    top: 4px;
}

/* ----- трекер: детали и чек ----- */

.track-addr {
    font-size: .9em;
    color: var(--cab-muted);
    margin-bottom: 10px;
}

.cab-check {
    margin-bottom: 0;
}

.cab-check td,
.cab-check th {
    border-color: #f0eee9;
}

.cab-check tr:first-child td {
    border-top: none;
}

.cab-paid {
    color: var(--cab-green);
}

/* бар отзыва после доставки: на мобильном — фиксированный у низа
   (футера там нет), на ПК — обычный блок между контентом и футером */
.footer {
    background-color: #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--cab-line);
    z-index: 5;
}

@media (min-width: 779px) {
    .footer {
        position: static;
        background: transparent;
        border-top: none;
        padding: 10px 0;
    }
}
