/* Layout overrides for Telegram WebApp */

/* Hide inactive screens, service details, and modals by default */
#service-detail,
.screen,
.modal,
.modal-backdrop {
    display: none !important;
}

/* Show only active screens or service detail */
.screen.active,
#service-detail.active {
    display: block !important;
}

/* Display active modals/backdrops as flex for centering */
.modal.active,
.modal-backdrop.active {
    display: flex !important;
}

/* Ensure content clears the fixed bottom navigation bar */
.wrap {
    padding-bottom: 120px !important;
}
#buy-service-description,
#buy-service-description ul {
    text-align: justify;
}

.buy-server-option {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.buy-server-option .icon, .buy-server-option .icon-spacer {
    font-size: 24px;
    line-height: 1;
    color: #f8fafc;
}

:root[data-theme="light"] .buy-server-option .icon, .buy-server-option .icon-spacer {
    color: #0f172a;
}

.buy-server-option .text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    text-align: right;
}

.buy-server-option .text .title {
    margin-left: 12px;
    font-weight: 700;
    font-size: 1.05em;
    color: #f8fafc;
}

:root[data-theme="light"] .buy-server-option .text .title {
    margin-left: 12px;
    color: #0f172a;
}

.buy-server-option .text .location {
    font-size: 0.9em;
    opacity: 0.78;
    color: rgba(226, 232, 240, 0.85);
}

:root[data-theme="light"] .buy-server-option .text .location {
    color: rgba(30, 41, 59, 0.75);
}

.buy-server-option .radio-wrap {
    display: flex;
    align-items: center;
}

.buy-server-option .radio-wrap input[type="radio"] {
    transform: scale(1.15);
    margin: 0;
}

.server-option.ww-opt {
    text-align: right;
}

.plan-option {
    text-align: right;
    padding: 16px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.plan-option:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(148, 163, 184, 0.4);
}

.plan-option .plan-option-content {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.plan-option .plan-option-radio {
    display: flex;
    align-items: center;
}

.plan-option .plan-option-radio input[type="radio"] {
    transform: scale(1.12);
    margin: 0;
}

.plan-option .plan-option-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-option .plan-option-title {
    font-weight: 700;
    font-size: 1.05em;
    color: #f8fafc;
}
:root[data-theme="light"] .plan-option .plan-option-title {
    color: #0f172a;
}

.plan-option .plan-option-meta {
    font-size: 0.9em;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.9);
}
:root[data-theme="light"] .plan-option .plan-option-meta {
    color: rgba(30, 41, 59, 0.75);
}

.plan-option .plan-option-desc {
    font-size: 0.85em;
    color: rgba(226, 232, 240, 0.75);
    line-height: 1.7;
}
:root[data-theme="light"] .plan-option .plan-option-desc {
    color: rgba(30, 41, 59, 0.65);
}

.plan-option .plan-option-price {
    min-width: 120px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

#buy-card-copy {
    font-weight: 600;
}

.buy-receipt-remove {
    border-radius: 12px;
}

#buy-r-plan-desc {
    text-align: justify;
}


#buy .ww-step .ww-opt {
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(100, 116, 139, 0.25);
    color: #f8fafc;
    font-weight: 600;
}

#buy .ww-step .ww-opt span {
    color: inherit;
    font-weight: 600;
}

#buy .ww-step .ww-opt input[type="radio"] {
    accent-color: #38bdf8;
}

:root[data-theme="light"] #buy .ww-step .ww-opt {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

:root[data-theme="light"] #buy .ww-step .ww-opt span {
    color: inherit;
}

.buy-server-option .icon-spacer { display:inline-block; width:8px; height:1px; }
