/* ========================================================================
   modules/site_constructor/site_constructor.css — «Конструктор сайтов»
   ======================================================================== */

.site-constructor {
    max-width: 640px;
    margin: 0 auto;
}

/* Поле имени и суффикс домена — одна строка даже на телефоне: суффикс
   сжимается с многоточием, а не переносит поле на следующую строку. */
.site-constructor .sc-domain-group {
    flex-wrap: nowrap;
}

/* css/style.css даёт всем input margin-bottom: 8px. В input-group
   элементы растягиваются по высоте ряда, и отступ отъедал у поля 8px —
   оно выглядело ниже соседнего блока с доменом. */
.site-constructor .sc-domain-group .form-control {
    min-width: 6rem;
    margin-bottom: 0;
}

/* Сам .input-group-text остаётся flex-контейнером (текст по центру по
   вертикали), а многоточие — на вложенном span: у flex-элемента
   text-overflow не работает. */
.site-constructor .sc-domain-group .input-group-text {
    max-width: 55%;
    min-width: 0;
}
.site-constructor .sc-domain-suffix {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Место под статус резервируем заранее, чтобы форма не прыгала при
   каждом нажатии клавиши. */
.site-constructor .sc-domain-status {
    min-height: 1.25rem;
}

.site-constructor .sc-domain-label {
    word-break: break-all;
}

/* ===== Выбор шаблона (2026-09-17) ===== */
.site-constructor .sc-templates {
    border: 0;
    padding: 0;
    min-width: 0;
}

.site-constructor .sc-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.site-constructor .sc-template {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

/* Радиокнопка остаётся в документе (клавиатура, скринридеры), но видна
   рамка карточки, а не кружок. */
.site-constructor .sc-template input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.site-constructor .sc-template__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    background: var(--bs-body-bg, #fff);
    transition: border-color .15s, box-shadow .15s;
}

.site-constructor .sc-template:hover .sc-template__body {
    border-color: var(--bs-primary, #0d6efd);
}

.site-constructor .sc-template input:checked + .sc-template__body {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}

.site-constructor .sc-template input:focus-visible + .sc-template__body {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.site-constructor .sc-template__name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.site-constructor .sc-template__desc {
    font-size: .85rem;
    color: var(--bs-secondary-color, #6c757d);
    overflow-wrap: anywhere;
}

/* ========================================================================
   Автосоздание сайта (2026-09-26): прелоадер вместо формы для вошедшего
   пользователя, приглашение войти для гостя. Цвета — от Bootstrap-
   переменных, чтобы тёмная тема сайта подхватывалась сама.
   ======================================================================== */
.sc-auto {
    display: flex;
    justify-content: center;
    padding: 48px 16px;
}

.sc-auto__card {
    width: 100%;
    max-width: 460px;
    text-align: center;
    padding: 32px 24px;
    border-radius: 16px;
    background: var(--bs-body-bg, #fff);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .08);
}

.sc-auto__logo {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 20px;
}

.sc-auto__logo span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bs-primary, #0d6efd);
    animation: sc-auto-dot 1.2s ease-in-out infinite;
}
.sc-auto__logo span:nth-child(2) { animation-delay: .15s; }
.sc-auto__logo span:nth-child(3) { animation-delay: .3s; }

@keyframes sc-auto-dot {
    0%, 80%, 100% { transform: scale(.6); opacity: .5; }
    40% { transform: scale(1); opacity: 1; }
}

.sc-auto__title {
    font-size: 1.35rem;
    margin: 0 0 8px;
}

.sc-auto__text {
    color: var(--bs-secondary-color, #6c757d);
    margin: 0 0 20px;
}

.sc-auto__bar {
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bs-secondary-bg, #e9ecef);
}

.sc-auto__bar span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 3px;
    background: var(--bs-primary, #0d6efd);
    animation: sc-auto-bar 1.4s ease-in-out infinite;
}

@keyframes sc-auto-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

.sc-auto__step {
    margin: 12px 0 0;
    font-size: .9rem;
    color: var(--bs-secondary-color, #6c757d);
}

.sc-auto__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.sc-auto__error { margin-top: 16px; }
.sc-auto__error-text { color: var(--bs-danger, #dc3545); margin: 0 0 12px; }

.sc-auto.is-error .sc-auto__bar,
.sc-auto.is-error .sc-auto__step,
.sc-auto.is-error .sc-auto__logo span { animation-play-state: paused; opacity: .4; }

@media (prefers-reduced-motion: reduce) {
    .sc-auto__logo span,
    .sc-auto__bar span { animation: none; }
    .sc-auto__bar span { width: 100%; opacity: .5; }
}

/* ===== «Мои сайты» под формой (2026-10-02) ===== */
.sc-my {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, .1);
}
.sc-my-title {
    font-size: 1.15rem;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.sc-my-count {
    font-size: .8rem;
    font-weight: 500;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
}
.sc-my-table td { vertical-align: middle; }
.sc-my-site a { font-weight: 600; word-break: break-all; }
.sc-my-site .badge { margin-top: .25rem; }
.sc-my-actions { white-space: nowrap; }
.sc-my-actions .btn + .btn { margin-left: .25rem; }
.sc-my-pending > td { background: rgba(220, 53, 69, .06); }
.sc-my-confirm > td { background: rgba(220, 53, 69, .06); border-top: 0; }
.sc-my-confirm-input { max-width: 280px; }

/* На телефоне строка таблицы — карточка: кнопки под адресом, без
   горизонтальной прокрутки. */
@media (max-width: 575.98px) {
    .sc-my-table thead { display: none; }
    .sc-my-table, .sc-my-table tbody, .sc-my-table tr, .sc-my-table td { display: block; width: 100%; }
    .sc-my-table tr { padding: .5rem 0; border-bottom: 1px solid rgba(0, 0, 0, .1); }
    .sc-my-table td { border: 0; padding: .15rem 0; }
    .sc-my-table td[data-label]::before { content: attr(data-label) ": "; opacity: .6; }
    .sc-my-table td[data-label] .small { display: inline; margin-left: .25rem; }
    .sc-my-table td.text-end { text-align: left !important; }
    .sc-my-actions { white-space: normal; }
    .sc-my-confirm-input { max-width: none; }
}

/* Тариф нового сайта (2026-10-02): карточки как у шаблонов */
.sc-tariff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .5rem;
}
.sc-my-account { margin-top: -.25rem; }
