/* =========================
   БАЗА
   ========================= */

   * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 system-ui, sans-serif;
    background-color: #1c202a;
    color: #ffffff;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 18px 24px;
    flex: 1; /* пристыковует футер к низу экрана */
}

/* =========================
   ШАПКА
   ========================= */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.logo {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* RU / EN */

.lang-switch {
    display: flex;
    align-items: center;
}

.lang-switch a {
    font-size: 12px;
    font-weight: 500;
    color: #b0b3c0;
    text-decoration: none;
    line-height: 1;
}

.lang-switch a + span {
    margin: 0 1px;
}

.lang-switch a.active {
    color: #ffffff;
}

/* =========================
   ЗАГОЛОВКИ / ТЕКСТ
   ========================= */

.hero-title,
.page-title {
    text-align: center;
    font-weight: 800;
    font-size: 30px;
    line-height: 1.3;
    margin-top: 8px;
    margin-bottom: 10px;
}

.page-subtitle,
.hero-subtitle {
    text-align: center;
    font-size: 15px;
    line-height: 1.4;
    color: #c4c7d4;
    margin: 0 auto 26px;
    max-width: 320px;
}

.page-title-lg {
    text-align: center;
    font-weight: 800;
    font-size: 32px;
    line-height: 1.3;
    margin-top: 60px;
    margin-bottom: 12px;
}

.loading-subtitle {
    text-align: center;
    font-size: 16px;
    color: #c4c7d4;
    line-height: 1.4;
    margin-bottom: 40px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.text-muted {
    font-size: 11px;
    color: #7c8297;
    line-height: 1.4;
}

.text-center { text-align: center; }

.text-link {
    color: #c4c7d4;
    text-decoration: underline;
}

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* =========================
   КНОПКИ
   ========================= */

.btn {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 18px;
    border-radius: 999px;
    cursor: pointer;
    text-align: center;
    margin-bottom: 14px;
}

.btn-gradient {
    background: linear-gradient(90deg, #5a3bff, #ff3db7);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.btn-green {
    background-color: #27b94a;
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
}

/* Соцкнопки */

.btn-social {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    outline: none;
    border-radius: 18px;
    padding: 14px 18px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
}

.btn-social .icon-wrap {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-social .icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.btn-social .label {
    flex: 1;
    text-align: center;
}

.btn-social span.icon {
    font-size: 20px;
}

/* цвета соцсетей */

.btn-vk { background-color: #0077ff; color: #ffffff; }
.btn-tg { background-color: #27a7e6; color: #ffffff; }
.btn-tt { background-color: #000000; color: #ffffff; }
.btn-ok { background-color: #ff8800; color: #ffffff; }

/* специальная кнопка для step2 */

.btn-templates {
    margin: 22px 0 18px;
}

/* =========================
   INPUTS / FORM
   ========================= */

.input {
    width: 100%;
    background-color: #111522;
    border-radius: 18px;
    border: 1px solid #5a5f73;
    padding: 14px 18px;
    font-size: 16px;
    color: #ffffff;
    outline: none;
    margin-bottom: 12px;
}

.input::placeholder {
    color: #9ca0b4;
    font-size: 16px;
}

.input-card {
    border-radius: 18px;
}

/* разделитель "или" */

.divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    font-size: 13px;
    color: #7c8297;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #3b3f4e;
}

.divider-text {
    margin: 0 10px;
}

/* =========================
   ГАЛЕРЕЯ НА ПЕРВОЙ СТРАНИЦЕ
   ========================= */

.gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 30px;
    scrollbar-width: none; /* Firefox */
        }

.gallery::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
        }

.gallery::-webkit-scrollbar-thumb {
    background: #33384a;
    border-radius: 999px;
        }

.gallery-item {
    flex: 0 0 100px;
    height: 100px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: #222637;
        }

.g1 { background-image: url("../img/i1.png"); }
.g2 { background-image: url("../img/i2.png"); }
.g3 { background-image: url("../img/i3.png"); }
.g4 { background-image: url("../img/i4.png"); }
.g5 { background-image: url("../img/i5.png"); }
.g6 { background-image: url("../img/i6.png"); }

/* =========================
   WHY SAFE
   ========================= */

.why-safe {
    margin-bottom: 26px;
}

.why-safe ul {
    list-style: none;
    margin-top: 10px;
}

.why-safe li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    color: #d0d3e2;
    margin-bottom: 6px;
}

.why-safe li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: #9ea3ff;
}

/* =========================
   STEP 1 – ВЫБОР ФОТО
   (вариант з квадратом)
   ========================= */

.upload-box {
    margin: 32px auto 24px;
    max-width: 275px;
    width: 100%;
}

.upload-square {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #111522;
}

.upload-square.placeholder {
    border: 2px dashed #d0d3e2;
}

.upload-square.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* старые классы — если где-то еще используются */
.upload-placeholder {
    border-radius: 24px;
    border: 2px dashed #d0d3e2;
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-photo {
    border-radius: 24px;
    overflow: hidden;
}

.upload-photo img {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================
   STEP 2 – ШАБЛОНЫ
   ========================= */

.templates-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.template-item {
    flex: 0 0 calc((100% - 20px) / 3); /* 3 в ряд */
    border-radius: 16px;
    overflow: hidden;
    background-color: #222637;
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-item.active {
    box-shadow: 0 0 0 2px #2f89ff;
}

/* старый вариант хедера с back-стрелкой */
.page-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.back-arrow {
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* =========================
   ТАРИФЫ / ОПЛАТА
   ========================= */

.title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 18px;
}

.back-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.page-title-left {
    margin: 0;
    text-align: left;
    font-weight: 800;
    font-size: 28px;
    line-height: 1.3;
    white-space: nowrap;
}

/* Тарифы */

.tariff-subtitle {
    text-align: center;
    font-size: 15px;
    line-height: 1.4;
    color: #c4c7d4;
    max-width: 320px;
    margin: 0 auto 22px;
}

.tariff-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tariff-card {
    border-radius: 20px;
    border: 1px solid #5a5f73;
    padding: 14px 20px;
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
}

.tariff-card .price {
    display: block;
    margin-top: 4px;
    font-size: 16px;
}

.tariff-card.active {
    border-color: #2f89ff;
    box-shadow: 0 0 0 2px #2f89ff;
}

/* Оплата */

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin: 10px 0 18px;
}

.payment-header span {
    white-space: nowrap;
}

.payment-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.payment-row .input {
    margin-bottom: 0;
}

/* =========================
   LOADING BAR
   ========================= */

.progress-bar {
    width: 100%;
    max-width: 320px;
    height: 16px;
    margin: 0 auto;
    border-radius: 999px;
    background: #202431;
    overflow: hidden;
}

.progress-fill {
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, #a2e62b, #00c853);
}

.loading-text {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-top: 80px;
    margin-bottom: 16px;
}

.loading-subtext {
    text-align: center;
    font-size: 16px;
    color: #c4c7d4;
    line-height: 1.4;
    min-height: 40px; /* чтобы текст не скакал */
    transition: opacity 0.4s;
}

.progress-bar {
    width: 100%;
    max-width: 320px;
    height: 16px;
    margin: 50px auto 0;
    border-radius: 999px;
    background: #202431;
    overflow: hidden;
        }

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #a2e62b, #00c853);
    transition: width 0.3s linear;
        }
/* =========================
   RESULT / AVATAR PREVIEW
   ========================= */

   .result-photo {
    width: 275px;
    height: 275px;
    border-radius: 24px;
    overflow: hidden;
    margin: 24px auto 26px;
    background-color: #111522;
}

.result-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================
   ACCOUNT PAGE
   ========================= */

.account-avatar {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    overflow: hidden;
    margin: 24px auto 16px;
    background-color: #111522;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account-name {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.account-username {
    text-align: center;
    font-size: 14px;
    color: #c4c7d4;
    margin-bottom: 10px;
}

.account-info {
    text-align: center;
    font-size: 13px;
    color: #c4c7d4;
    line-height: 1.4;
    margin-bottom: 26px;
}

/* =========================
   MY AVATARS GRID
   ========================= */

.avatars-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.avatar-item {
    flex: 0 0 calc((100% - 24px) / 3);
    border-radius: 18px;
    overflow: hidden;
    background-color: #222637;
}

.avatar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================
   PAYMENTS LIST
   ========================= */

.payments-list {
    margin-top: 16px;
}

.payment-card {
    border-radius: 20px;
    border: 1px solid #5a5f73;
    padding: 10px 16px 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.payment-card-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.payment-card-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-card-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    border: 1px solid #5a5f73;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.payment-card-number {
    letter-spacing: 1px;
}

.payment-card-amount {
    font-size: 15px;
}

.payment-card-date {
    font-size: 12px;
    color: #c4c7d4;
    margin-bottom: 4px;
}

.payment-card-separator {
    height: 1px;
    border-bottom: 1px dashed #5a5f73;
}


/* =========================
   ФУТЕР
   ========================= */

.footer {
    width: 100%;
    text-align: center;
    padding: 14px 10px 18px;
    font-size: 11px;
    color: #7c8297;
}

.footer-links a {
    color: #7c8297;
    text-decoration: none;
    margin: 0 4px;
}

.footer-links a:hover {
    text-decoration: underline;
}
