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

:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0f2244;
    --bg-tertiary: #141028;
    --text-primary: #ebf0f5;
    --text-secondary: #b5b9bc;
    --accent: #00c8be;
    --accent-hover: #00ada3;
    --border: #2a1f4a;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(135deg, #0a1628 0%, #0f2244 50%, #0d1f3a 100%);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.landing {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    text-align: center;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.header {
    margin-top: 20px;
}

.logo {
    display: inline-block;
}

.logo-text {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-astray {
    color: #ebf0f5;
}

.logo-vpn {
    color: #00c8be;
    font-weight: 800;
}

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

.title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideUp 0.3s ease;
    padding: 0 30px;
}

.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: -10px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #00b1c8 0%, #00c8be 100%);
    color: #0f0720;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
    font-weight: 700;
}

.btn-primary:hover {
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid #00d4ff;
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: #ebf0f5;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.footer {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.config-header h2 {
    margin-bottom: 0;
    font-size: 24px;
    font-weight: 700;
}

.timer {
    font-size: 28px;
    font-weight: 700;
    color: #00c8be;
    text-align: center;
    min-width: 80px;
}

.config-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin: -16px 0 12px 0;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: transparent;
    border-radius: 8px;
    border: none;
    max-width: 360px;
    width: 100%;
}

.qr-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.qr-code {
    background: white;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    flex-shrink: 0;
}

.qr-code canvas {
    display: block;
}

.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.qr-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-modal-canvas {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-modal-canvas canvas {
    display: block;
}

.qr-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 3001;
}

.qr-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.config-text-container {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.config-textarea {
    flex: 1;
    padding: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.config-textarea:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.copy-btn {
    padding: 12px 24px;
    white-space: nowrap;
    align-self: stretch;
    width: 100%;
}

.toast {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    animation: slideInRight 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

.toast.show {
    display: block;
}

.toast.success {
    background: #10b981;
    color: #ebf0f5;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.toast.error {
    background: #ef4444;
    color: #ebf0f5;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@media (max-width: 768px) {
    .title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }

    .landing {
        min-height: auto;
        justify-content: center;
        gap: 30px;
    }

    .content {
        gap: 30px;
    }

    .header {
        margin-top: 0;
    }

    .footer {
        padding: 16px;
        font-size: 13px;
        gap: 10px;
    }

    .config-text-container {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
        align-self: stretch;
    }

    .config-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .timer {
        text-align: center;
        margin-bottom: 10px;
    }

    .timer-container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .hero {
        gap: 8px;
    }

    .buttons {
        gap: 12px;
        max-width: 100%;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
        border-radius: 6px;
    }

    .logo-text {
        font-size: 26px;
    }

    .config-textarea {
        min-height: 100px;
        font-size: 11px;
    }

    .qr-container {
        display: none !important;
    }

    .copy-btn {
        width: 100%;
        align-self: stretch;
    }

    .timer-container {
        justify-content: center;
        margin-bottom: -10px;
    }

    .timer {
        font-size: 32px;
    }

    .footer {
        padding: 12px;
        gap: 8px;
    }
}

@media (min-width: 769px) {
    .timer-container {
        justify-content: center;
        margin-bottom: -10px;
    }

    .timer {
        font-size: 48px;
        font-weight: 700;
        color: #00c8be;
    }

    .qr-container {
        justify-content: center;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Поддержка тёмного режима системы */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0e27;
        --bg-secondary: #141829;
    }
}
