/* Denny VPN — Web Portal CSS */
/* Полностью адаптивный дизайн: mobile-first */

/* Google Fonts loaded via <link preload> in HTML — no @import needed */

:root {
    --bg-color: #0f0f13;
    --text-color: #ffffff;
    --card-bg: rgba(28, 28, 35, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #2a81f3;
    --secondary: #2c2c36;
    --danger: #ff3b30;
    --success: #34c759;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    /* Gradient background for premium feel */
    background: linear-gradient(135deg, #0f0f13 0%, #1a1a2e 50%, #0f0f13 100%);
    background-attachment: fixed;
}

/* Custom scrollbar — subtle */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

/* --- Screens --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.2s ease;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* --- Typography --- */
h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    color: #8e8e93;
    font-size: 14px;
    margin-bottom: 16px;
}

/* --- AUTH SCREEN --- */
.auth-wrapper {
    justify-content: flex-start;
    align-items: center;
    padding-top: 6vh;
    padding-bottom: 24px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 30px rgba(42, 129, 243, 0.4));
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #8e8e93;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(42, 129, 243, 0.3);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 129, 243, 0.15);
}

.auth-input::placeholder {
    color: #555;
}

.auth-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 10px;
    color: #ff3b30;
    font-size: 13px;
    text-align: center;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.15s, transform 0.15s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    opacity: 0.8;
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--primary);
}

.btn.secondary {
    background: var(--secondary);
    color: var(--text-color);
}

.btn.outline {
    background: transparent;
    border: 1.5px solid var(--card-border);
    color: var(--text-color);
}

/* Nav buttons should not stretch full-width */
.main-nav .btn {
    width: auto;
}

.btn.text {
    background: transparent;
    color: #8e8e93;
    font-weight: 500;
    font-size: 14px;
}

.btn.connect-btn {
    background: linear-gradient(135deg, #FF9500, #FF5E3A);
    font-size: 16px;
}

.btn.tg-login-btn {
    background: linear-gradient(135deg, #2AABEE, #229ED9);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 14px;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.2s;
    box-shadow: none;
}

.btn.tg-login-btn:hover {
    box-shadow: 0 2px 12px rgba(42, 171, 238, 0.3);
}

.btn.sm {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.w-100 {
    width: 100%;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

/* --- Device Grid --- */
.devices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.device-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.device-card:hover {
    border-color: rgba(42, 129, 243, 0.3);
}

.device-emoji {
    font-size: 36px;
    line-height: 1;
}

.device-card span:last-child {
    font-weight: 500;
    font-size: 14px;
    color: #8e8e93;
}

.device-card.selected {
    background: rgba(42, 129, 243, 0.15);
    border-color: var(--primary);
}

.device-card.selected .device-emoji,
.device-card.selected span:last-child {
    color: var(--primary);
}

.device-card-wide {
    grid-column: 1 / -1;
}

.auto-detect-msg {
    text-align: center;
    font-size: 13px;
    color: var(--success);
    background: rgba(52, 199, 89, 0.1);
    padding: 8px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

/* --- Download Box --- */
.download-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    margin: 8px 0 14px;
}

.download-box p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Big prominent download button */
.btn.download-btn-big {
    background: linear-gradient(135deg, #34c759, #30d158, #28cd50);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    padding: 18px 24px;
    border-radius: 16px;
    border: none;
    width: 100%;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(52, 199, 89, 0.4), 0 0 0 0 rgba(52, 199, 89, 0.5);
    animation: downloadPulse 2s ease-in-out infinite;
    text-transform: none;
}

.btn.download-btn-big:active {
    transform: scale(0.97);
    opacity: 0.9;
}

@keyframes downloadPulse {
    0% { box-shadow: 0 4px 20px rgba(52, 199, 89, 0.4), 0 0 0 0 rgba(52, 199, 89, 0.4); }
    50% { box-shadow: 0 6px 28px rgba(52, 199, 89, 0.5), 0 0 0 8px rgba(52, 199, 89, 0); }
    100% { box-shadow: 0 4px 20px rgba(52, 199, 89, 0.4), 0 0 0 0 rgba(52, 199, 89, 0.4); }
}

.nav-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 100%;
}

.nav-buttons .btn.text {
    flex: 0 0 auto;
    width: auto;
}

.nav-buttons .btn.primary {
    flex: 1;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.radio-group label {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
}

.radio-group input {
    display: none;
}

.radio-group label:has(input:checked) {
    border-color: var(--primary);
    background: rgba(42, 129, 243, 0.1);
}

.small-hint {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 6px;
}

/* Instruction Box */
.instruction-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.instruction-box ol {
    margin-left: 18px;
    font-size: 13px;
    color: #e5e5ea;
}

.instruction-box li {
    margin-bottom: 6px;
}

.warning-text {
    margin-top: 10px;
    font-size: 12px;
    color: #ff9f0a;
    font-weight: 500;
}

.config-actions {
    margin: 12px 0;
}

.or-divider {
    text-align: center;
    color: #ff3b30;
    font-size: 14px;
    font-weight: 700;
    margin: 10px 0;
}

/* --- Cabinet --- */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.user-info h3 {
    margin-bottom: 0;
}

.status-badge {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.expired {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger);
}

.status-badge.trial {
    background: rgba(255, 149, 0, 0.15);
    color: #FF9500;
}

.main-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    backdrop-filter: blur(12px);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Tariffs */
.tariffs-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.tariff-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tariff-info {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

.t-main {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
    color: #FF9500;
    margin-bottom: 10px;
}

.t-price {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

/* Device Item */
.device-item {
    display: flex;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dev-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dev-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(42, 129, 243, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dev-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dev-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.dev-type-badge {
    font-size: 11px;
    color: #8e8e93;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 5px;
}

.dev-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.dev-actions .btn {
    flex: 1 1 auto;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    margin-right: 10px;
    cursor: pointer;
}

/* L2TP Config */
.l2tp-config {
    margin: 16px 0;
}

.l2tp-field {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.l2tp-label {
    font-size: 12px;
    color: #8e8e93;
    display: block;
    margin-bottom: 2px;
}

.l2tp-value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.l2tp-value {
    font-size: 15px;
    font-weight: 600;
}

.l2tp-copy-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

/* Spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.spinner.sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
    margin-bottom: 0;
}

#loader {
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    z-index: 100;
}

/* --- Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
    padding: 16px;
}

.modal.active {
    display: flex;
}

.upsell-modal-center {
    align-items: center;
}

.modal-content {
    background: #1c1c23;
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    padding: 24px;
    position: relative;
    border: 1px solid var(--card-border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 26px;
    color: #8e8e93;
    cursor: pointer;
}

/* Months Modal */
.months-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.month-card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    display: block;
    transition: border-color 0.2s;
}

.month-card:hover {
    border-color: rgba(42, 129, 243, 0.3);
}

/* --- Desktop Layout Adjustments --- */
@media (min-width: 768px) {
    .screen {
        max-width: 800px;
        padding: 40px;
    }

    /* Cabinet Grid Layout */
    #screen-cabinet {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-content: start;
    }

    #screen-cabinet .header {
        grid-column: 1 / -1;
        margin-bottom: 8px;
    }

    #screen-cabinet > .main-card {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        height: 100%;
    }

    /* Devices card spans multiple rows if needed */
    #screen-cabinet > .main-card:nth-child(3) {
        grid-column: 2 / 3;
        grid-row: 2 / 5;
    }

    /* Tariff, Support, and Logout stacked in left column */
    #screen-cabinet > .main-card:nth-child(2),
    #screen-cabinet > .main-card:nth-child(4),
    #screen-cabinet > .main-card:nth-child(5) {
        grid-column: 1 / 2;
    }
}

.month-card input {
    display: none;
}

.month-card:has(input:checked) {
    border-color: var(--primary);
    background: rgba(42, 129, 243, 0.1);
}

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

.month-duration {
    font-size: 16px;
    font-weight: 600;
}

.month-price {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
}

.month-old-price {
    font-size: 14px;
    color: #8e8e93;
    margin-top: 2px;
}

.month-price-sale {
    color: #FF9500;
}

.month-price-best {
    color: #FFD60A;
}

.sale-badge {
    display: inline-block;
    background: rgba(255, 149, 0, 0.2);
    color: #FF9500;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.sale-badge-best {
    background: rgba(255, 214, 10, 0.2);
    color: #FFD60A;
}

.month-card-hot {
    border-color: rgba(255, 149, 0, 0.3);
}

.month-card-best {
    border-color: rgba(255, 214, 10, 0.3);
}

/* --- Payment Method Selector --- */
.payment-methods-selector {
    display: flex;
    gap: 8px;
}

.pm-card {
    flex: 1;
    display: block;
    cursor: pointer;
}

.pm-card input {
    display: none;
}

.pm-card-inner {
    border: 2px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 6px;
    background: var(--card-bg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: border-color 0.2s, background 0.2s;
}

.pm-card:has(input:checked) .pm-card-inner {
    border-color: var(--primary);
    background: rgba(42, 129, 243, 0.1);
}

.pm-card:hover .pm-card-inner {
    border-color: rgba(42, 129, 243, 0.3);
}

.pm-icon {
    font-size: 22px;
    line-height: 1;
}

.pm-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 199, 89, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease;
    max-width: calc(100% - 32px);
    text-align: center;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* --- CAPTCHA Status --- */
.captcha-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.captcha-status.solving {
    background: rgba(42, 129, 243, 0.1);
    border: 1px solid rgba(42, 129, 243, 0.25);
    color: #6aafff;
}

.captcha-status.solved {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.25);
    color: #34c759;
}

.captcha-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(42, 129, 243, 0.3);
    border-top-color: #2a81f3;
    border-radius: 50%;
    animation: captchaSpin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes captchaSpin {
    100% {
        transform: rotate(360deg);
    }
}

/* Cabinet link button on onboarding screens */
.cabinet-link-btn {
    margin-top: 16px;
    background: transparent !important;
    color: #8e8e93 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 10px 16px !important;
}

.cabinet-link-btn:hover {
    color: #fff !important;
}



/* --- Wizard Auth Styles --- */
.wizard-header {
    text-align: center;
    margin-bottom: 20px;
}

.wizard-title {
    font-size: 17px;
    font-weight: 600;
    color: #e5e5ea;
    line-height: 1.45;
    margin: 0;
}

.auth-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #8e8e93;
    margin-bottom: 8px;
}

/* Email display on password screen */
.auth-email-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(42, 129, 243, 0.08);
    border: 1px solid rgba(42, 129, 243, 0.2);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    color: #6aafff;
}

.auth-email-edit {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.auth-email-edit:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Registration success */
.auth-success-message {
    text-align: center;
    padding: 8px 0 20px;
}

.auth-success-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.auth-success-message p {
    margin: 0 0 4px;
    font-size: 15px;
    color: #c7c7cc;
    line-height: 1.4;
}

.auth-success-email {
    font-weight: 700 !important;
    color: #2a81f3 !important;
    font-size: 17px !important;
    margin: 8px 0 !important;
    word-break: break-all;
}

.auth-success-hint {
    font-size: 13px !important;
    color: #ff9f0a !important;
    font-weight: 500;
    margin-top: 8px !important;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding: 12px 0;
}

.auth-footer a {
    color: #555;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.15s;
}

.auth-footer a:hover {
    color: #8e8e93;
}

.auth-footer-sep {
    color: #333;
    margin: 0 6px;
    font-size: 10px;
}

/* Forgot password link */
.btn-forgot-password {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: #6aafff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 12px 0 4px;
    text-align: center;
    transition: color 0.15s;
}

.btn-forgot-password:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-forgot-password:disabled {
    color: #555;
    cursor: default;
    text-decoration: none;
}

/* Continue without password note */
.auth-continue-note {
    text-align: center;
    font-size: 14px;
    color: #34c759;
    font-weight: 500;
    margin: 12px 0 16px;
}

/* Fade-in animation for wizard screens */
#screen-auth-email.active,
#screen-auth-password.active,
#screen-auth-registered.active {
    animation: wizardFadeIn 0.3s ease;
}

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

/* --- Features Section --- */
.features-section {
    margin-top: 24px;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out;
}

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

.features-title {
    font-size: 16px;
    color: #fff;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 16px;
    gap: 16px;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    background: rgba(42, 129, 243, 0.08);
    border-color: rgba(42, 129, 243, 0.3);
}

.feature-icon {
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.feature-text {
    flex: 1;
}

.feature-text h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #fff;
}

.feature-text p {
    font-size: 13px;
    color: #8e8e93;
    margin: 0;
    line-height: 1.3;
}

/* --- About Section --- */
.about-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    margin-top: 24px;
}

.about-section h3 {
    text-align: center;
    margin-bottom: 16px;
}

.about-section p {
    font-size: 14px;
    color: #e5e5ea;
    line-height: 1.6;
    text-align: justify;
    margin: 0;
}

/* --- Reviews Section --- */
.reviews-section {
    margin-top: 24px;
}

.reviews-section h3 {
    text-align: center;
    margin-bottom: 16px;
}

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

.review-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.review-name {
    font-size: 14px;
    font-weight: 600;
}

.review-stars {
    color: #FFCF33;
    font-size: 12px;
}

.review-text {
    font-size: 13px;
    color: #e5e5ea;
    line-height: 1.5;
    margin: 0;
}

/* --- Contacts Section --- */
.contacts-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.contacts-section h3 {
    margin-bottom: 12px;
}

.contacts-section .contacts-desc {
    font-size: 14px;
    color: #e5e5ea;
    margin-bottom: 16px;
}

.contacts-section .contacts-link {
    text-decoration: none;
    margin-bottom: 12px;
}

.contacts-section .contacts-info {
    font-size: 13px;
    color: #8e8e93;
    margin: 0;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* --- Tablet (520px+) --- */
@media (min-width: 520px) {
    .screen {
        border-left: 1px solid var(--card-border);
        border-right: 1px solid var(--card-border);
        box-shadow: 0 0 60px rgba(42, 129, 243, 0.05);
    }

    .features-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .features-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
}

/* --- Medium screens (768px+) --- */
@media (min-width: 768px) {
    .screen {
        max-width: 600px;
    }

    .auth-card {
        max-width: 440px;
    }
}

/* --- Medium screens (600px+) — features 2x2 --- */
@media (min-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Wide Desktop (900px+) — Two columns: auth + features --- */
@media (min-width: 900px) {
    .screen {
        max-width: 960px;
    }

    #screen-auth-email .auth-wrapper {
        display: grid;
        grid-template-columns: 420px 1fr;
        grid-template-areas:
            "logo   logo"
            "nav    nav"
            "card   right"
            "about  about"
            "contacts contacts"
            "bottom bottom";
        column-gap: 40px;
        row-gap: 0;
        align-items: start;
    }

    #screen-auth-email .auth-logo {
        grid-area: logo;
        margin-bottom: 16px;
    }

    #screen-auth-email .main-nav {
        grid-area: nav;
        margin-bottom: 24px;
    }

    #screen-auth-email .auth-card {
        grid-area: card;
        width: 100%;
        margin: 0;
        position: sticky;
        top: 20px;
    }

    #screen-auth-email .auth-right-content {
        grid-area: right;
    }

    #screen-auth-email .full-width-section.about-section {
        grid-area: about;
        margin-top: 32px;
    }

    #screen-auth-email .full-width-section.contacts-section {
        grid-area: contacts;
        margin-top: 16px;
    }

    #screen-auth-email .auth-bottom-text {
        grid-area: bottom;
    }

    /* Full-width sections styled as cards */
    .full-width-section {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 16px;
        padding: 28px 32px;
        backdrop-filter: blur(12px);
    }

    .full-width-section h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .auth-footer {
        text-align: left;
    }

    #screen-cabinet {
        max-width: 800px;
    }

    #screen-tariffs {
        max-width: 800px;
    }
}

/* --- Extra-wide Desktop (1200px+) --- */
@media (min-width: 1200px) {
    .screen {
        max-width: 1100px;
    }

    #screen-auth-email .auth-wrapper {
        grid-template-columns: 440px 1fr;
        column-gap: 56px;
    }

    .reviews-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    #screen-cabinet {
        max-width: 900px;
    }

    #screen-tariffs {
        max-width: 900px;
    }
}

/* --- Ultra-wide Desktop (1600px+) --- */
@media (min-width: 1600px) {
    .screen {
        max-width: 1300px;
    }

    #screen-auth-email .auth-wrapper {
        grid-template-columns: 480px 1fr;
        column-gap: 72px;
    }

    #screen-cabinet {
        max-width: 1000px;
    }

    #screen-tariffs {
        max-width: 1000px;
    }
}

/* --- Tall desktop — restore vertical centering --- */
@media (min-height: 900px) {
    .auth-wrapper {
        justify-content: center;
        padding-top: 0;
    }
}

/* --- Mobile optimization (small phones) --- */
@media (max-width: 360px) {
    .screen {
        padding: 16px;
    }

    .auth-card {
        padding: 16px;
    }

    .auth-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    h1 {
        font-size: 24px;
    }

    .feature-item {
        padding: 12px 14px;
        gap: 12px;
    }

    .feature-icon {
        font-size: 24px;
    }

    .feature-text h4 {
        font-size: 14px;
    }

    .feature-text p {
        font-size: 12px;
    }

    .features-title {
        font-size: 15px;
    }

    .logo-icon {
        font-size: 48px;
    }

    .auth-logo {
        margin-bottom: 20px;
    }

    .about-section {
        padding: 16px;
    }

    .review-card {
        padding: 12px;
    }

    .contacts-section {
        padding: 16px;
    }
}

/* Very short screens — compact auth layout */
@media (max-height: 680px) {
    .auth-wrapper {
        padding-top: 12px;
    }

    .auth-logo {
        margin-bottom: 16px;
    }

    .logo-icon {
        font-size: 44px;
        margin-bottom: 6px;
    }

    h1 {
        font-size: 22px;
    }

    .auth-card {
        padding: 16px;
    }
}
