﻿/* --- изменения и существующие стили --- */

:root {
    --bg: #f5f7fb;
    --card-bg: #ffffff;
    --primary: #6c63ff;
    --primary-hover: #574fe8;
    --text: #2c2c2c;
    --muted: #777;
    --border: #e4e6ef;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
}
/* ===== RESET ===== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Inter, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}
/* ===== LAYOUT ===== */

.page-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

    .header h1 {
        margin: 0;
        font-size: 32px;
    }

    .header p {
        margin-top: 8px;
        color: var(--muted);
    }
/* ===== CARD ===== */

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}
/* ===== CARD GRID (home) ===== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
/* горизонтальная версия на узких экранах */

.card-grid--home .card-link {
    text-decoration: none;
    color: inherit;
}
/* Новые правила: делаем внутренние карточки одинаковой высоты и выравниваем кнопку внизу */

.card-grid--home .card {
    height: 100%;
}

.card-grid--home .home-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* кнопка прижата к низу карточки */
    height: 100%;
    cursor: pointer;
}

.card-grid--home .card-body { /* содержимое карточки (заголовок + текст) */
}

.card-grid--home .card-footer {
    margin-top: 12px;
}
/* адаптация для маленьких экранов — поведение не изменено, чтобы не ломать мобильную верстку */

@media (max-width: 600px) {
    .card-grid--home {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

        .card-grid--home .card-link {
            flex: 0 0 260px; /* карточка фиксированной ширины в строке */
            scroll-snap-align: start;
        }

    .card-grid--home {
        scroll-snap-type: x mandatory;
    }
}
/* ===== FORM ===== */

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

input[type="text"], input[type="password"], select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 15px;
}

input[type="range"] {
    width: 100%;
}
/* ===== SIZE BUTTONS ===== */

.size-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    align-items: center;
}

.size-btn {
    background: #f0f2ff;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    touch-action: manipulation;
}

    .size-btn:hover {
        background: #e8ebff;
    }

    .size-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }
/* ===== BUTTON ===== */

button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    touch-action: manipulation;
}

    button:hover {
        background: var(--primary-hover);
    }
/* ===== QR LAYOUT ===== */ /* увеличил вторую колонку до 480px — это показывает оптимальный вид */

.qr-layout {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 30px;
    align-items: center; /* центруем колонки, чтобы кнопки выровнялись */
    grid-auto-rows: minmax(0, auto);
}
/* ===== QR BOX ===== */

.qr-box {
    background: #fafbff;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 360px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
}
/* preview outline (динамическая пунктирная рамка — изменяется JS) */

.qr-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px dashed #1b6ec2;
    background: rgba(27,110,194,0.02);
    box-sizing: border-box;
    display: none;
    pointer-events: none;
    width: 220px;
    height: 220px;
    max-width: 95%;
    max-height: 95%;
    z-index: 10;
    border-radius: 6px;
}
/* стиль плейсхолдера — теперь круглый и центрированный */

.qr-placeholder {
    width: 220px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(27,110,194,0.03), rgba(255,255,255,0.01));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
    border: 2px dashed var(--border);
    box-shadow: var(--shadow);
    padding: 18px;
    box-sizing: border-box;
    z-index: 1;
}
/* Ограничения для изображений QR — изображение остаётся квадратным и не выходит за рамки */

.qr-box img, .qr-image {
    display: block;
    max-width: 420px;
    max-height: 420px;
    width: auto;
    height: auto;
    image-rendering: pixelated;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 2;
}
/* маленький блок для рекламы */

.ad-placeholder.ad-small {
    padding: 14px;
    margin-top: 18px;
    font-size: 14px;
}
/* ===== RESPONSIVE: MOBILE ===== */

@media (max-width: 900px) {
    .page-wrapper {
        margin: 20px auto;
        padding: 0 16px;
    }
    /* меняем порядок: QR над формой */

    .qr-layout {
        display: flex;
        flex-direction: column-reverse;
        gap: 18px;
    }

    .qr-box {
        min-height: auto;
        padding: 14px;
    }

    .size-buttons {
        gap: 8px;
        flex-wrap: wrap;
    }

    .qr-layout > div {
        width: 100%;
    }

    button {
        padding: 12px;
        font-size: 15px;
    }
    /* на мобильных показываем встроенный маленький блок рекламы (тот, что в правой колонке) */

    .ad-area {
        display: none;
    }
    /* оставляем встроенный .ad-placeholder.ad-small видимым */

    .card .ad-placeholder.ad-small {
        display: block;
    }
}
/* Desktop behavior: прячем встроенный маленький блок рекламы внутри карточки и показываем внешний */

@media (min-width: 901px) {
    .card .ad-placeholder.ad-small {
        display: none;
    }

    .ad-area {
        display: block;
    }
    /* задаём вторую строку в гриде — внешний блок рекламы визуально под карточкой */

    .qr-layout {
        grid-template-rows: auto; /* оставляем одну строку для карточки */
    }
}
/* touch optimizations */

a, button, .size-btn {
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
    touch-action: manipulation;
}
/* ===== Правильный sticky footer ===== */

.layout-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

    .layout-body > .container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .layout-body main {
        flex: 1;
    }






/*:root {
    --bg: #f5f7fb;
    --card-bg: #ffffff;
    --primary: #6c63ff;
    --primary-hover: #574fe8;
    --text: #2c2c2c;
    --muted: #777;
    --border: #e4e6ef;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
}*/

/* ===== RESET ===== */
/** {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Inter, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}*/

/* ===== LAYOUT ===== */
/*.page-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

    .header h1 {
        margin: 0;
        font-size: 32px;
    }

    .header p {
        margin-top: 8px;
        color: var(--muted);
    }

.muted-text {
    color: var(--muted);
}*/

/* ===== CARD ===== */
/*.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}*/

/* ===== HOME GRID ===== */
/*.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card-link {
    text-decoration: none;
    color: inherit;
}

    .card-link:focus,
    .card-link:active {
        background: none;
    }

.home-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    cursor: pointer;
}

.card-footer {
    margin-top: 12px;
}*/

/* ===== FORM ===== */
/*.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 15px;
}*/

/* ===== SIZE BUTTONS ===== */
/*.size-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
*/
/*.size-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: nowrap; 
}

.size-btn {
    background: #f0f2ff;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}

    .size-btn:hover {
        background: #e8ebff;
    }

    .size-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }*/

/* ===== BUTTON ===== */
/*button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}

    button:hover {
        background: var(--primary-hover);
    }*/

/* ===== QR LAYOUT ===== */
/*.qr-layout {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 30px;
    align-items: start;
}*/

/* ===== QR BOX ===== */
/*.qr-box {
    background: #fafbff;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 360px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
}*/
/*.qr-box {
    background: #fafbff;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 360px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
}
    .qr-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px dashed #1b6ec2;
    background: rgba(27,110,194,0.02);
    display: none;
    pointer-events: none;
}

.qr-placeholder {
    width: 220px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
    border: 2px dashed var(--border);
}

.qr-image {
    max-width: 420px;
    max-height: 420px;
    image-rendering: pixelated;
    border-radius: 10px;
    box-shadow: var(--shadow);
}*/

/* ===== ADAPTIVE MOBILE ===== */
/*@media (max-width: 900px) {

    .page-wrapper {
        margin: 20px auto;
        padding: 0 16px;
    }*/

    /* Вертикальный порядок */
    /*.qr-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }*/

    /* Карточки на главной — вертикально */
    /*.card-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .card {
        padding: 20px;
    }

    .qr-box {
        min-height: auto;
    }

    button {
        padding: 12px;
        font-size: 15px;
    }
}*/

/* Desktop ad logic */
/*@media (min-width: 901px) {
    .ad-placeholder.ad-small {
        display: none;
    }
}

a, button {
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
}
.home-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-btn-link {
    text-decoration: none;
}

    .create-btn-link button {
        width: 100%;
    }*/
/* Главная страница — карточки с кнопкой внутри */

/*.card-grid--home .home-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 220px;
}

.card-grid--home .card-button {
    margin-top: 20px;
}*/

/* Увеличиваем карточки только на десктопе */
/*@media (min-width: 992px) {
    .card-grid--home .home-card {
        min-height: 260px;
        padding: 35px;
    }

    .card-grid--home h3 {
        font-size: 1.4rem;
    }

    .card-grid--home .muted-text {
        font-size: 1rem;
    }
}*/
/* ===== Правильный sticky footer ===== */

/*.layout-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

    .layout-body > .container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .layout-body main {
        flex: 1;
    }*/

