/* Запрет выделения текста на всех элементах */
body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Запрет перетаскивания картинок */
img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

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

html, body {
    width: 100%;
    min-height: 100%;
    font-family: Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: #bfe8ff url("/static/fon.png") center center / cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* =========================================================
   MAIN PAGE LAYOUT
========================================================== */
.page {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.stack {
    width: 100%;
    max-width: 1100px;          /* увеличено */
    position: relative;
}

.screens-wrap {
    width: 100%;
    max-width: 1100px;          /* увеличено */
}

/* =========================================================
   TOP LOGO
========================================================== */
.logo-wrap,
.logo-zone {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    margin-bottom: -42px;
}

.logo-img {
    width: min(100%, 560px);
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 24px rgba(70, 130, 200, 0.18));
    transform-origin: center top;
}

.page.success-mode .logo-img {
    transform: scale(0.82);
}

.logo-switch {
    transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.logo-switch.is-changing {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    filter: blur(4px) drop-shadow(0 10px 24px rgba(70, 130, 200, 0.1));
}

/* =========================================================
   SCREEN STAGE
========================================================== */
.screen-stage {
    position: relative;
    width: 100%;
    max-width: 1100px;          /* увеличено */
    transition: height 0.55s ease;
}

.screen {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(28px) scale(0.985);
    filter: blur(10px);
    transition:
        opacity 0.55s ease,
        transform 0.55s ease,
        filter 0.55s ease,
        visibility 0s linear 0.55s;
}

.screen.screen-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition:
        opacity 0.55s ease,
        transform 0.55s ease,
        filter 0.55s ease,
        visibility 0s linear 0s;
}

/* =========================================================
   MAIN CARD
========================================================== */
.card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(89, 156, 214, 0.18), inset 0 1px 0 rgba(255,255,255,0.85);
    padding: 72px 28px 28px;
    backdrop-filter: blur(4px);
}

.title {
    text-align: center;
    color: #6d6d6d;
    font-size: 18px;
    margin-bottom: 14px;
    font-weight: 400;
}

.info-text {
    text-align: center;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* =========================================================
   BUTTONS
========================================================== */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 10px;
}

.btn-extend,
.btn-detach {
    flex: 1;
    text-align: center;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-extend {
    background: #9ce6ff;
    color: #1e3c4a;
}
.btn-extend:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(156, 230, 255, 0.4);
}

.btn-detach {
    background: #fed7f2;
    color: #6a1b4d;
}
.btn-detach:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(254, 215, 242, 0.4);
}

.btn-green {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    width: auto;
    min-width: 220px;
    max-width: 100%;
    transition: all 0.3s ease;
    display: inline-block;
}
.btn-green:hover {
    background: #219150;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39,174,96,0.3);
}

/* =========================================================
   PHONE INPUT
========================================================== */
.phone-input {
    width: 100%;
    height: 64px;
    border: 2px solid #dfe3e8;
    border-radius: 16px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 20px;
    letter-spacing: 1px;
    margin-bottom: 18px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
    text-align: center;
    font-family: Arial, sans-serif;
    outline: none;
}

/* =========================================================
   SUCCESS SCREEN
========================================================== */
.success-shell {
    width: 100%;
    padding-top: 0;
    margin-top: -34px;
}

.success-head {
    width: 100%;
    max-width: 870px; /* МЕНЯЙ ТОЛЬКО ЭТО ЧИСЛО */
    margin: 0 auto -24px;
    padding: 24px 28px;
    text-align: center;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    color: #3a78d4;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 34px;
    box-shadow: 0 16px 34px rgba(89, 156, 214, 0.18);
    position: relative;
    z-index: 3;
}

.success-card-large {
    width: 100%;
    max-width: 800px;          /* увеличено */
    margin: 0 auto;
    padding: 46px 40px 24px;   /* отступы увеличены */
    background: rgba(255, 255, 255, 0.94);
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(89, 156, 214, 0.18), inset 0 1px 0 rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
}

.success-content-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px; /* МЕНЯЙ ТОЛЬКО ЭТО ЧИСЛО ДЛЯ ШИРИНЫ help.png */
    gap: 24px;
    align-items: center;
}

.success-copy {
    min-width: 0;
}

.success-lead {
    text-align: left;
    color: #42556b;
    font-size: 18px;
    line-height: 1.55;
    margin: 0 0 24px;
}

.success-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 28px;
}

.success-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: #42556b;
    font-size: 17px;
    line-height: 1.5;
}

.success-check {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #67c85c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 8px 18px rgba(103, 200, 92, 0.25);
}

.success-visual {
    position: relative;
    width: 200px;  /* МЕНЯЙ ТОЛЬКО ЭТО ЧИСЛО ДЛЯ ШИРИНЫ/ВЫСОТЫ БЛОКА ПОД help.png */
    height: 200px; /* СТАВЬ ТАКОЕ ЖЕ ЧИСЛО, КАК СТРОКОЙ ВЫШЕ */
    margin: 0 auto;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), rgba(255,255,255,0.65) 38%, rgba(173, 228, 255, 0.85) 72%, rgba(124, 205, 255, 0.92) 100%);
    box-shadow: inset 0 10px 30px rgba(255,255,255,0.55), 0 14px 30px rgba(103, 165, 230, 0.18);
}

.visual-circle,
.visual-circle::before,
.visual-circle::after {
    position: absolute;
    content: "";
    display: block;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
}

.visual-circle {
    width: 72px;
    height: 72px;
    left: 24px;
    bottom: 22px;
}

.visual-circle::before {
    width: 34px;
    height: 34px;
    right: -70px;
    top: 18px;
}

.visual-circle::after {
    width: 20px;
    height: 20px;
    left: 96px;
    bottom: 58px;
}

.visual-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.96);
    color: #4f88de;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 10px 20px rgba(98, 159, 229, 0.18);
}

.visual-badge-top {
    top: 26px;
    right: -8px;
}

.visual-badge-mid {
    top: 78px;
    left: -12px;
}

.visual-badge-bottom {
    right: 8px;
    bottom: 18px;
}

.success-close {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: -2px auto 0;
    border-radius: 14px;
    padding: 14px 22px;
    font-weight: 700;
}

/* =========================================================
   BOTTOM FOOTER
========================================================== */
.footer {
    margin-top: 30px;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 15px 20px;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.page.success-mode .footer {
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.footer-left {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-link {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}
.footer-link:hover {
    color: #2f7bf3;
}

.social-btn {
    width: 28px;
    height: 28px;
    background: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}
.social-btn img {
    width: 20px;
    height: 20px;
    display: block;
}
.social-btn:hover {
    transform: translateY(-2px);
}

.copyright {
    color: #777;
    font-size: 11px;
    text-align: center;
    margin-top: 8px;
}

/* =========================================================
   MODALS
========================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal.modal-visible {
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 25px 20px;
    border-radius: 24px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(12px) scale(0.985);
    transition: transform 0.28s ease;
}

.modal-visible .modal-content {
    transform: translateY(0) scale(1);
}

.modal-small {
    max-width: 300px;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.red-text {
    font-weight: 700;
    font-size: 30px;
    line-height: 1.2;
    margin: 0 0 16px;
    color: #d32f2f;
}

.green-text {
    font-weight: 700;
    font-size: 30px;
    line-height: 1.2;
    margin: 0 0 16px;
    color: #27ae60;
}

.normal-text {
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
    color: #2c3e50;
    text-align: center;
}

#codeValue {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 6px;
    color: #2f7bf3;
    margin: 15px 0;
}

.btn-blue {
    background: linear-gradient(180deg, #3f92ff 0%, #2f7bf3 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 10px 22px rgba(47, 123, 243, 0.28);
    transition: all 0.3s ease;
}
.btn-blue:hover {
    background: linear-gradient(180deg, #2f86fa 0%, #2468dd 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(47, 123, 243, 0.34);
}

.hidden {
    display: none !important;
}

.gos-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #dfe7f5;
    border-top-color: #58b9f3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   MEDIA QUERIES
========================================================== */
@media (max-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 100vh;
        padding: 10px;
    }

    .page {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 100%;
    }

    .stack,
    .screens-wrap {
        max-width: 100%;
    }

    .logo-wrap,
    .logo-zone {
        margin-bottom: -34px;
    }

    .logo-img {
        width: min(100%, 460px);
    }

    .page.success-mode .logo-img {
        transform: scale(0.84);
    }

    .card {
        max-width: 430px;
        padding: 58px 20px 20px;
        border-radius: 24px;
        margin: 0 auto;
    }

    .title {
        font-size: 16px;
    }

    .info-text {
        font-size: 14px;
    }

    .phone-input {
        height: 56px;
        font-size: 18px;
    }

    .btn-extend,
    .btn-detach {
        padding: 10px 16px;
        font-size: 14px;
    }

    .success-shell {
        margin-top: -26px;
    }

    .success-head {
        font-size: 24px;
        padding: 20px 18px;
        border-radius: 28px;
        margin-bottom: -18px;
        max-width: 100%;
    }

    .success-card-large {
        padding: 38px 20px 20px;
        border-radius: 24px;
        max-width: 100%;
    }

    .success-content-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .success-lead {
        font-size: 16px;
    }

    .success-item {
        font-size: 15px;
        gap: 12px;
    }

    .success-check {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 18px;
    }

    .success-visual {
        width: 260px;
        height: 260px;
    }

    .footer {
        width: 100%;
        margin-top: auto;
        border-radius: 20px;
        padding: 15px 20px;
    }

    .red-text,
    .green-text {
        font-size: 24px;
    }

    .normal-text {
        font-size: 12px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .footer-left {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-right {
        margin-top: 5px;
    }

    .footer-link {
        font-size: 12px;
    }

    .copyright {
        font-size: 10px;
    }

    .btn-green {
        min-width: 200px;
        font-size: 14px;
        padding: 11px 18px;
    }
}

@media (max-width: 640px) {
    .card {
        padding: 48px 18px 18px;
    }
    .btn-green {
        min-width: 180px;
        font-size: 14px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 14px;
    }

    .logo-wrap,
    .logo-zone {
        margin-bottom: -26px;
    }

    .logo-img {
        width: 100%;
        max-width: 360px;
    }

    .page.success-mode .logo-img {
        transform: scale(0.86);
    }

    .card {
        max-width: 100%;
        padding: 48px 16px 16px;
        border-radius: 22px;
    }

    .success-shell {
        margin-top: -18px;
    }

    .title {
        font-size: 15px;
    }

    .info-text {
        font-size: 14px;
    }

    .phone-input {
        height: 52px;
        font-size: 16px;
        border-radius: 14px;
    }

    .btn-extend,
    .btn-detach {
        padding: 8px 12px;
        font-size: 13px;
    }

    .success-head {
        font-size: 20px;
        padding: 18px 16px;
        border-radius: 24px;
    }

    .success-card-large {
        padding: 38px 16px 18px;
        border-radius: 22px;
    }

    .success-lead {
        font-size: 14px;
    }

    .success-item {
        font-size: 13px;
        gap: 10px;
    }

    .success-check {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 16px;
    }

    .success-visual {
        width: 132px;
        height: 132px;
    }

    .success-close {
        max-width: 300px;
        padding: 12px 18px;
    }

    .footer {
        width: 100%;
        margin: 16px 0 0;
        border-radius: 18px;
        padding: 12px 15px;
    }

    .modal-content {
        max-width: 280px;
        padding: 20px 15px;
    }

    .normal-text {
        font-size: 11px;
        margin-bottom: 15px;
    }

    .red-text,
    .green-text {
        font-size: 22px;
    }

    .btn-green {
        min-width: 165px;
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* =========================================================
   SUCCESS IMAGE OVERRIDES
========================================================== */
.success-card-large {
    padding-bottom: 20px;
}

.success-list {
    margin-bottom: 0;
}

.success-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-help-img {
    width: 100%;
    max-width: 320px; /* МЕНЯЙ ТОЛЬКО ЭТО ЧИСЛО ДЛЯ РАЗМЕРА help.png */
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(89, 156, 214, 0.14));
}

.visual-circle,
.visual-badge,
.success-close {
    display: none !important;
}

@media (max-width: 768px) {
    .success-help-img {
        max-width: 260px; /* МОБИЛКА */
    }
}

@media (max-width: 640px) {
    .success-content-row {
        grid-template-columns: 1fr;
    }

    .success-visual {
        margin-top: 6px;
    }

    .success-help-img {
        max-width: 220px; /* МОБИЛКА <= 640px */
    }
}