* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background-color: #4a4a4a;
    color: #333;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("/static/images/bg.jpg");
    background-repeat: repeat;
    opacity: 0.55;
}

[data-theme="dark"] body {
    background-color: #0f1824;
    background-image: radial-gradient(circle at top, #1b2a3c 0, #0f1824 55%, #050811 100%);
    color: #e8edf5;
}

[data-theme="dark"] body::before {
    display: none;
}

.login-tg-page {
    width: 100%;
    max-width: 460px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-tg-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

[data-theme="dark"] .login-tg-card {
    background: rgba(18, 28, 42, 0.95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-tg-header {
    text-align: center;
    margin-bottom: 0;
}

.bot-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

[data-theme="dark"] .bot-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.bot-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

.bot-name {
    font-weight: 600;
    font-size: 15px;
}

.bot-name-inline {
    font-weight: 600;
    color: #667eea;
}

[data-theme="dark"] .bot-name-inline {
    color: #52b6ff;
}

.login-tg-header h1 {
    font-size: 22px;
    margin-bottom: 10px;
}

.header-instruction {
    font-size: 16px;
    line-height: 1.45;
    color: #555;
    max-width: 100%;
}

[data-theme="dark"] .header-instruction {
    color: #a4b2c8;
}

.login-tg-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.qr-section-main {
    text-align: center;
    width: 100%;
}

.qr-wrapper {
    position: relative;
    display: inline-block;
    width: 220px;
    height: 220px;
    margin-bottom: 10px;
}

.qr-image {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
}

.qr-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

[data-theme="dark"] .qr-placeholder {
    background: rgba(18, 28, 42, 0.9);
    color: #e8edf5;
}

.qr-center-badge {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: qr-badge-pulse 2s ease-in-out infinite;
}

[data-theme="dark"] .qr-center-badge {
    background: rgba(20, 30, 48, 0.95);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.qr-badge-icon {
    width: 26px;
    height: 26px;
    color: #667eea;
    stroke-width: 2;
}

[data-theme="dark"] .qr-badge-icon {
    color: #52b6ff;
}

@keyframes qr-badge-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.9; }
}

.qr-status-main {
    font-size: 16px;
    color: #555;
}

[data-theme="dark"] .qr-status-main {
    color: #c1ccde;
}

.steps-section {
    margin-top: 4px;
    text-align: center;
    width: 100%;
}

.steps-section h2 {
    font-size: 17px;
    margin-bottom: 10px;
}

.steps-list {
    list-style: decimal;
    list-style-position: inside;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #555;
}

[data-theme="dark"] .steps-list {
    color: #b6c3d8;
}

.steps-list li {
    margin-bottom: 8px;
}

.service-section {
    margin-top: 12px;
    border-top: 1px solid #e0e0e0;
    padding-top: 12px;
    width: 100%;
    text-align: center;
}

[data-theme="dark"] .service-section {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.service-details {
    width: 100%;
}

.service-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
    color: #666;
    font-size: 16px;
    list-style: none;
}

[data-theme="dark"] .service-summary {
    color: #9aabc5;
}

.service-summary::-webkit-details-marker {
    display: none;
}

.service-summary::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-right: 4px;
    transition: transform 0.2s;
}

.service-details[open] .service-summary::before {
    transform: rotate(180deg);
}

.service-content {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 16px;
    color: #555;
    text-align: left;
}

[data-theme="dark"] .service-content {
    color: #b6c3d8;
}

.service-block {
    text-align: center;
}

.service-block h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.service-block p {
    margin-bottom: 10px;
    font-size: 16px;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: transparent;
    color: #333;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

[data-theme="dark"] .link-button {
    border-color: rgba(255, 255, 255, 0.2);
    color: #e8edf5;
}

.link-button:hover {
    background: rgba(82, 182, 255, 0.12);
    border-color: rgba(82, 182, 255, 0.4);
}

.link-button:active {
    transform: translateY(1px);
}

.admin-form .form-group {
    margin-bottom: 10px;
}

.admin-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    color: #333;
}

[data-theme="dark"] .admin-form label {
    color: #d0d9eb;
}

.admin-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #333;
    font-size: 16px;
}

.admin-form input:focus {
    outline: none;
    border-color: #667eea;
}

[data-theme="dark"] .admin-form input {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(4, 9, 18, 0.9);
    color: #e8edf5;
}

[data-theme="dark"] .admin-form input:focus {
    border-color: rgba(82, 182, 255, 0.7);
}

.info-text {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
}

[data-theme="dark"] .info-text {
    color: #8b9ab5;
}

.btn {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #52b6ff 0%, #3f8bff 40%, #6f5bff 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn:hover {
    box-shadow: 0 8px 24px rgba(82, 182, 255, 0.4);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.error {
    background: rgba(208, 69, 69, 0.12);
    color: #c33;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 15px;
    display: none;
    border: 1px solid rgba(200, 80, 80, 0.4);
}

[data-theme="dark"] .error {
    color: #ffb3b3;
    border-color: rgba(255, 115, 115, 0.4);
}

.qr-registration-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    font-size: 16px;
}

.qr-registration-text {
    margin: 0;
    color: #555;
    font-size: 16px;
}

[data-theme="dark"] .qr-registration-text {
    color: #b6c3d8;
}

.qr-registration-link {
    font-size: 16px;
}

.qr-btn-secondary {
    padding: 10px 16px;
    font-size: 16px;
}

.error.show {
    display: block;
}

.login-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    color: #333333;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.login-theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

[data-theme="dark"] .login-theme-toggle {
    background-color: rgba(5, 11, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e8edf5;
}

[data-theme="dark"] .login-theme-toggle:hover {
    background-color: rgba(10, 19, 34, 0.9);
}

/* Контактный телефон — сверху справа, не перекрывает контент */
.contact-phone-login2 {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: background 0.2s, transform 0.2s;
}

.contact-phone-login2:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.contact-phone-login2 .icon-inline {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.contact-phone-login2 span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .contact-phone-login2 {
    background: rgba(18, 28, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8edf5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .contact-phone-login2:hover {
    background: rgba(24, 36, 52, 0.98);
}

.login-tg-card .icon-inline {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    stroke-width: 2;
}

@media (max-width: 400px) {
    .login-tg-page {
        max-width: 100%;
    }

    .login-theme-toggle {
        top: 12px;
        right: 12px;
    }

    .contact-phone-login2 {
        top: 64px;
        right: 12px;
        left: 12px;
        max-width: none;
        justify-content: center;
    }

    .contact-phone-login2 span {
        white-space: normal;
        text-align: center;
    }
}

/* Калиграфическая подпись справа внизу */
.login-slogan {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    margin: 0;
    font-family: 'Marck Script', cursive;
    font-size: 1.75rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    transform: rotate(-3deg);
}

[data-theme="dark"] .login-slogan {
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 400px) {
    .login-slogan {
        font-size: 1.35rem;
        bottom: 16px;
        right: 16px;
    }
}

