@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

:root {
    --accent: #a54dbb;
    --accent-hover: #8e3da3;
    --accent-light: rgba(165, 77, 187, 0.12);
    --accent-light-hover: rgba(165, 77, 187, 0.2);
}

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

body {
    font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f5fa 0%, #f0ebf3 50%, #e8e0ed 100%);
    color: #2d2d2d;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    text-align: center;
    margin-bottom: 28px;
}

.page-header .logo {
    display: block;
    margin: 0 auto 16px;
    max-width: 120px;
    height: auto;
    border-radius: 12px;
}

.page-header h1 {
    margin-bottom: 0;
}

/* Tabs: Вход/Регистрация и Подписка/Выберите тариф — один стиль */
.auth-tabs-wrap,
.cabinet-tabs-wrap {
    margin-bottom: 16px;
}

.auth-tabs,
.cabinet-tabs {
    display: flex;
    gap: 8px;
    border-radius: 10px;
    padding: 4px;
}

.auth-tab,
.cabinet-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(165, 77, 187, 0.25);
    background: transparent;
    color: #6b6b6b;
    border-radius: 8px;
    cursor: pointer;
    padding: 12px 16px;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.auth-tab .icon,
.cabinet-tab .icon {
    width: 18px;
    height: 18px;
}

.auth-tab:hover,
.cabinet-tab:hover {
    color: #2d2d2d;
    border-color: rgba(165, 77, 187, 0.35);
}

.auth-tab.auth-tab--active,
.cabinet-tab.cabinet-tab--active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.auth-tab.auth-tab--active:hover,
.cabinet-tab.cabinet-tab--active:hover {
    background: var(--accent-hover);
    color: #fff;
    border-color: var(--accent-hover);
}

.section-title--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #1a1a1a;
    font-weight: 700;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(165, 77, 187, 0.2);
    box-shadow: 0 2px 12px rgba(165, 77, 187, 0.06);
}

input,
button {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #d0c5d4;
    margin-bottom: 12px;
    font-size: 16px;
}

input {
    background: #fff;
    color: #2d2d2d;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover {
    background: var(--accent-hover);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: icon-spin 0.7s linear infinite;
}

/* Loading skeleton for blocks */
.loading-skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.plans-loading {
    padding: 24px;
    text-align: center;
    color: #6b6b6b;
    font-size: 14px;
}

.divider {
    text-align: center;
    margin: 16px 0;
    color: #6b6b6b;
    font-size: 14px;
}

.link {
    color: var(--accent);
    text-decoration: none;
}

.link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.error {
    color: #ef4444;
    margin-bottom: 12px;
    font-size: 14px;
}

.success {
    color: #22c55e;
}

/* Icons */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
    margin-right: 0.35em;
}

.icon:last-child {
    margin-right: 0;
}

.icon svg {
    width: 1.2em;
    height: 1.2em;
}

.section-title .icon,
.section-title--sm .icon,
.modal-title .icon,
h1 .icon {
    color: var(--accent);
}

.icon--lg svg {
    width: 1.5em;
    height: 1.5em;
}

.icon--sm svg {
    width: 1em;
    height: 1em;
}

.icon-spin {
    animation: icon-spin 0.8s linear infinite;
}

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

.done-msg {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

/* Cabinet - subscription info */
#subscription-info {
    font-size: 15px;
    line-height: 1.6;
    padding: 20px;
    background: var(--accent-light);
    border-radius: 10px;
    margin-bottom: 12px;
}

.sub-status-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sub-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sub-status-dot--active {
    background: #22c55e;
}

.sub-status-dot--expired {
    background: #ef4444;
}

.sub-expiry {
    font-size: 14px;
    color: #5a5a5a;
    margin-top: 4px;
}

.sub-details {
    margin-top: 0;
}

.sub-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid rgba(165, 77, 187, 0.15);
    gap: 12px;
}

.sub-detail-row:last-child {
    border-bottom: none;
}

.sub-detail-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b6b6b;
    flex-shrink: 0;
}

.sub-detail-label .icon--xs {
    color: var(--accent);
    opacity: 0.9;
}

.sub-detail-label .icon--xs svg {
    width: 14px;
    height: 14px;
}

.sub-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
}

.sub-pending {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(165, 77, 187, 0.25);
    font-size: 14px;
    color: #5a5a5a;
}

.sub-error {
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: #ef4444;
}

/* Plans */
.plans-intro {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light, #e8e8e8);
}

.plans-intro-title {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.plans-intro-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary, #555);
    line-height: 1.6;
}

.plans-intro-list li {
    margin-bottom: 4px;
}

.plans-intro-list li:last-child {
    margin-bottom: 0;
}

.plans-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
}

.plan-selectable {
    cursor: pointer;
    margin: 0;
    border-radius: 10px;
    border: 2px solid rgba(165, 77, 187, 0.35);
    background: #fff;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.plan-selectable:hover {
    background: var(--accent-light);
    border-color: rgba(165, 77, 187, 0.5);
    box-shadow: 0 2px 8px rgba(165, 77, 187, 0.15);
}

.plan-selectable.selected {
    background: var(--accent-light-hover);
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(165, 77, 187, 0.25);
}

/* Buttons - unified */
.pay-btn,
.tg-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s, transform 0.1s;
}

.pay-btn:hover,
.tg-attach-btn:hover {
    transform: translateY(-1px);
}

.pay-btn {
    width: auto !important;
    margin-bottom: 0 !important;
}

.pay-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.tg-attach-btn {
    background: var(--accent);
    color: #fff !important;
    text-decoration: none;
}

.tg-attach-btn:hover {
    background: var(--accent-hover);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    border: 1px solid rgba(165, 77, 187, 0.25);
    box-shadow: 0 8px 32px rgba(165, 77, 187, 0.15);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #e8e0ed;
    color: #2d2d2d;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close:hover {
    background: var(--accent-light);
    color: var(--accent);
}

#telegram-attach-modal-body {
    min-height: 50px;
}

#tg-widget-wrap {
    display: flex;
    justify-content: center;
}

#telegram-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

#telegram-login-container iframe {
    margin: 0 auto;
}

.login-form-tagline {
    display: block;
    width: 100%;
    margin: 0 0 16px 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary, #555);
    text-align: center;
    line-height: 1.5;
}

.login-form-footer {
    margin-top: 16px;
    text-align: center;
}

/* Utility */
.hidden {
    display: none !important;
}

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

/* Widget compact (iframe) */
.body-widget-compact {
    margin: 0;
    padding: 12px;
    background: transparent;
}

body.body-widget-compact {
    background: linear-gradient(135deg, #f8f5fa 0%, #f0ebf3 100%);
    color: #2d2d2d;
}

/* Container variants */
.container--top {
    padding-top: 48px;
}

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

/* Typography */
.section-title {
    margin-bottom: 16px;
}

.section-title--sm {
    margin-bottom: 12px;
    font-size: 1rem;
}

.text-muted {
    margin-top: 8px;
    font-size: 14px;
}

.text-muted--16 {
    margin-top: 16px;
    font-size: 14px;
}

.text-muted-block {
    margin-bottom: 12px;
    color: #5a5a5a;
    font-size: 14px;
}

.text-muted-block--16 {
    margin-bottom: 16px;
    color: #5a5a5a;
    font-size: 14px;
}

.text-muted-darker {
    margin-top: 16px;
    font-size: 14px;
    color: #6b6b6b;
}

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

.footer-bot-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--accent);
    text-decoration: none;
}

.footer-bot-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.footer-bot-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.link-block {
    display: block;
    margin-top: 12px;
}

.link-spaced {
    margin-top: 20px;
}

.link-spaced--16 {
    margin-top: 16px;
}

/* Attach Telegram block */
.attach-block {
    background: var(--accent-light);
    border: 1px solid rgba(165, 77, 187, 0.25);
}

/* Purchase area */
.purchase-area {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(165, 77, 187, 0.25);
}

.purchase-hint {
    font-size: 14px;
    color: #5a5a5a;
    margin-bottom: 16px;
    line-height: 1.5;
}

.purchase-error {
    margin-top: 12px;
    font-size: 14px;
}

/* Logout button */
.btn-logout {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(165, 77, 187, 0.25);
    background: #e8e0ed;
    color: #2d2d2d;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-logout:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: rgba(165, 77, 187, 0.35);
}

.cabinet-panel.hidden {
    display: none !important;
}

/* Cabinet */
.cabinet-view .card {
    margin-bottom: 20px;
}

.card-subscription .section-title {
    margin-bottom: 12px;
}

.subscription-info-block {
    min-height: 60px;
}

.sub-url-wrap {
    margin-top: 12px;
    text-align: center;
}

.sub-url-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-light);
    border-radius: 8px;
}

.sub-url-link:hover {
    background: var(--accent-light-hover);
}

.btn-full {
    width: 100% !important;
}

.cabinet-actions {
    margin-top: 8px;
}

.pay-btn-balance {
    background: #22c55e;
}

.pay-btn-balance:hover {
    background: #16a34a;
}

.pay-btn-card {
    background: var(--accent);
}

.pay-btn-card:hover {
    background: var(--accent-hover);
}



.btn-primary {
    width: 100%;
    padding: 14px;
}

/* FAQ section (collapsible at bottom) */
.faq-section {
    margin-top: 20px;
}

.faq-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: 1px solid rgba(165, 77, 187, 0.25);
    border-radius: 10px;
    background: #fff;
    color: #2d2d2d;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.faq-section-toggle:hover {
    background: var(--accent-light);
    border-color: rgba(165, 77, 187, 0.35);
}

.faq-section-arrow {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #6b6b6b;
    border-bottom: 1.5px solid #6b6b6b;
    transform: rotate(-45deg);
    transition: transform 0.2s;
}

.faq-section-toggle[aria-expanded="true"] .faq-section-arrow {
    transform: rotate(135deg);
}

.faq-block {
    margin-top: 12px;
}

/* FAQ accordion */
.card-faq {
    padding: 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
}

.faq-item {
    border-bottom: 1px solid rgba(165, 77, 187, 0.15);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: #2d2d2d;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-question:hover {
    background: var(--accent-light);
}

.faq-toggle {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-right: 1.5px solid #6b6b6b;
    border-bottom: 1.5px solid #6b6b6b;
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.faq-item--open .faq-toggle {
    transform: rotate(-135deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.faq-item--open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 24px 16px;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #5a5a5a;
}

/* Modal */
.modal.hidden {
    display: none !important;
}

.modal-title {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.modal-desc {
    margin-bottom: 16px;
    color: #5a5a5a;
    font-size: 14px;
}

.modal-body-hint {
    color: #5a5a5a;
    margin-bottom: 16px;
}

.modal-body-hint--20 {
    color: #5a5a5a;
    margin-bottom: 20px;
}

.modal-error {
    color: #ef4444;
}

/* Done page (post-link) */
.body-done {
    margin: 0;
    padding: 24px;
    font-family: 'Golos Text', sans-serif;
    background: linear-gradient(135deg, #f8f5fa 0%, #f0ebf3 100%);
    color: #2d2d2d;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Success/error message colors for dynamic use */
.text-success {
    color: #22c55e;
}

.text-error {
    color: #ef4444;
}
