/* Основные стили для VPN Horizen PWA - Точное соответствие референсам */

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

:root {
    --primary-green: #ADF43D;
    --primary-cyan: #57DDC3;
    --primary-black: #000000;
    --primary-purple: #8162FC;
    --text-primary: #1C1C1E;
    --text-secondary: #C7C7CC;
    --bg-white: #FFFFFF;
    --bg-dark: #242426;
    --bg-gradient-off: linear-gradient(156.46deg, #000000 -0.65%, #ADF43D 65.17%);
    --bg-gradient-on: linear-gradient(156.46deg, #57DDC3 -0.65%, #ADF43D 65.17%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'SF Pro Text', 'TT Firs Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: var(--bg-gradient-off);
}

.hidden {
    display: none !important;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Страница загрузки */
.loading-screen {
    background: var(--bg-gradient-off);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
}

.logo-container {
    margin-bottom: 60px;
}

.logo {
    width: 120px;
    height: 120px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 700;
    color: var(--primary-black);
    margin: 0 auto;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.loading-animation {
    margin-top: 40px;
}

.vpn-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.dot-1 { animation-delay: 0s; }
.dot-2 { animation-delay: 0.2s; }
.dot-3 { animation-delay: 0.4s; }
.dot-4 { animation-delay: 0.6s; }
.dot-5 { animation-delay: 0.8s; }

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

.loading-text {
    color: var(--bg-white);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.41px;
    font-family: 'SF Pro Rounded', sans-serif;
}

/* Экран авторизации */
.auth-screen {
    background: var(--bg-gradient-off);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

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

.logo-large {
    width: 100px;
    height: 100px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 700;
    color: var(--primary-black);
    margin: 0 auto 20px;
}

.auth-logo h1 {
    color: var(--bg-white);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 0.36px;
    font-family: 'TT Firs Neue', sans-serif;
}

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

.input-field {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
    font-size: 16px;
    font-family: 'SF Pro Rounded', sans-serif;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-green);
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary-green);
    color: var(--primary-black);
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'SF Pro Rounded', sans-serif;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.auth-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 8px;
    font-family: 'SF Pro Rounded', sans-serif;
}

.error-message {
    color: #ff4444;
    text-align: center;
    font-size: 14px;
    padding: 12px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 8px;
    font-family: 'SF Pro Rounded', sans-serif;
}

/* Главный экран */
.main-screen {
    background: var(--bg-gradient-off);
    transition: background 0.5s ease;
    position: relative;
}

.main-screen.connected {
    background: var(--bg-gradient-on);
}

/* Фоновый лист (декоративный элемент) */
.main-screen::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 442px;
    left: 0;
    top: 0;
    opacity: 0.05;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48L3N2Zz4=');
    pointer-events: none;
}

/* Статус бар iOS */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    height: 44px;
    color: var(--bg-white);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.165px;
    font-family: 'SF Pro Text', sans-serif;
    position: relative;
    z-index: 10;
}

.status-time {
    width: 32px;
    height: 18px;
    text-align: center;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 68px;
    height: 14px;
}

.signal-icon, .wifi-icon, .battery-icon {
    font-size: 12px;
    opacity: 0.9;
}

/* Верхнее меню */
.top-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    position: relative;
    z-index: 10;
}

.menu-button {
    width: 26px;
    height: 26px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
}

.menu-icon {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--bg-white);
    border-radius: 2px;
    position: absolute;
    left: 12.5%;
    right: 12.5%;
}

.menu-icon::before {
    top: 25%;
}

.menu-icon::after {
    bottom: 25%;
}

.menu-icon {
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
    background: var(--bg-white);
    border-radius: 2px;
    left: 12.5%;
    right: 12.5%;
}

.app-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--bg-white);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.36px;
    font-family: 'TT Firs Neue', sans-serif;
    line-height: 34px;
}

.country-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--bg-white);
    background: #C4C4C4;
}

/* Статус подключения */
.status-section {
    padding: 0 24px;
    margin-top: 48px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 10;
}

.status-info,
.time-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-label,
.time-label {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.41px;
    color: var(--bg-white);
    font-family: 'SF Pro Rounded', sans-serif;
    line-height: 21px;
}

.status-value,
.time-value {
    font-size: 20px;
    font-weight: 500;
    line-height: 25px;
    color: var(--bg-white);
    font-family: 'TT Firs Neue', sans-serif;
    text-shadow: 0px 100px 80px rgba(28, 28, 30, 0.07), 0px 41.7776px 33.4221px rgba(28, 28, 30, 0.0503198), 0px 22.3363px 17.869px rgba(28, 28, 30, 0.0417275), 0px 12.5216px 10.0172px rgba(28, 28, 30, 0.035), 0px 6.6501px 5.32008px rgba(28, 28, 30, 0.0282725), 0px 2.76726px 2.21381px rgba(28, 28, 30, 0.0196802);
}

/* Кнопка подключения */
.connection-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    position: relative;
    z-index: 1;
}

.connection-button {
    width: 172px;
    height: 172px;
    border-radius: 50%;
    background: var(--bg-white);
    border: none;
    box-shadow: 0px 100px 80px rgba(28, 28, 30, 0.07), 0px 41.7776px 33.4221px rgba(28, 28, 30, 0.0503198), 0px 22.3363px 17.869px rgba(28, 28, 30, 0.0417275), 0px 12.5216px 10.0172px rgba(28, 28, 30, 0.035), 0px 6.6501px 5.32008px rgba(28, 28, 30, 0.0282725), 0px 2.76726px 2.21381px rgba(28, 28, 30, 0.0196802);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.connection-button:active {
    transform: scale(0.95);
}

.connection-button.connected {
    background: var(--bg-white);
}

.button-icon {
    width: 55px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-icon svg {
    width: 100%;
    height: 100%;
}

.button-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.36px;
    color: var(--text-primary);
    font-family: 'SF Pro Rounded', sans-serif;
    line-height: 25px;
    text-shadow: 0px 100px 80px rgba(28, 28, 30, 0.07), 0px 41.7776px 33.4221px rgba(28, 28, 30, 0.0503198), 0px 22.3363px 17.869px rgba(28, 28, 30, 0.0417275), 0px 12.5216px 10.0172px rgba(28, 28, 30, 0.035), 0px 6.6501px 5.32008px rgba(28, 28, 30, 0.0282725), 0px 2.76726px 2.21381px rgba(28, 28, 30, 0.0196802);
}

/* Декоративный круг за кнопкой */
.connection-button-container::before {
    content: '';
    position: absolute;
    width: 216px;
    height: 216px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-purple);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
}

/* Выбор сервера */
.server-section {
    padding: 0 24px;
    margin-top: 56px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.server-label {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.41px;
    color: var(--text-secondary);
    font-family: 'SF Pro Rounded', sans-serif;
    line-height: 21px;
}

.server-selector {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0;
    cursor: pointer;
    height: 26px;
}

.server-name {
    font-size: 20px;
    font-weight: 500;
    line-height: 25px;
    color: var(--text-primary);
    font-family: 'TT Firs Neue', sans-serif;
    text-shadow: 0px 100px 80px rgba(28, 28, 30, 0.07), 0px 41.7776px 33.4221px rgba(28, 28, 30, 0.0503198), 0px 22.3363px 17.869px rgba(28, 28, 30, 0.0417275), 0px 12.5216px 10.0172px rgba(28, 28, 30, 0.035), 0px 6.6501px 5.32008px rgba(28, 28, 30, 0.0282725), 0px 2.76726px 2.21381px rgba(28, 28, 30, 0.0196802);
}

.server-arrow {
    font-size: 26px;
    color: var(--text-primary);
    font-weight: 300;
    line-height: 26px;
}

/* Блок продуктов */
.products-section {
    background: var(--bg-dark);
    border-radius: 16px;
    padding: 24px 32px 24px 24px;
    margin: 24px;
    margin-top: 56px;
    position: relative;
    z-index: 10;
}

.products-title {
    font-size: 20px;
    font-weight: 500;
    line-height: 25px;
    color: var(--primary-green);
    margin-bottom: 16px;
    font-family: 'TT Firs Neue', sans-serif;
}

.products-list {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1px 0;
}

.product-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.product-name {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.41px;
    color: var(--bg-white);
    font-family: 'SF Pro Rounded', sans-serif;
    line-height: 21px;
}

/* Белый фон внизу */
.main-screen::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 456px;
    left: 0;
    bottom: 0;
    background: var(--bg-white);
    z-index: 0;
}

/* Меню */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--bg-white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.menu-overlay.active .menu-panel {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e5e5;
}

.menu-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'TT Firs Neue', sans-serif;
}

.menu-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
}

.menu-items {
    padding: 16px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:active {
    background: #f5f5f5;
}

.menu-item .menu-icon {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item span:last-child {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    font-family: 'SF Pro Rounded', sans-serif;
}

/* Экраны */
.screen-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid #e5e5e5;
}

.back-button {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 32px;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1;
}

.screen-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'TT Firs Neue', sans-serif;
}

/* Профиль */
.profile-screen {
    background: var(--bg-white);
}

.profile-content {
    padding: 24px;
}

.profile-card {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e5e5;
}

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

.profile-label {
    font-size: 16px;
    color: var(--text-secondary);
    font-family: 'SF Pro Rounded', sans-serif;
}

.profile-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'SF Pro Rounded', sans-serif;
}

/* Список серверов */
.server-screen {
    background: var(--bg-white);
}

.server-list {
    padding: 16px 24px;
}

.server-item {
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background 0.2s;
}

.server-item:active {
    background: #f5f5f5;
}

.server-item-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: 'TT Firs Neue', sans-serif;
}

.server-item-sni {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'SF Pro Rounded', sans-serif;
}

/* Кнопка установки PWA */
.install-pwa-button {
    position: fixed;
    top: 60px;
    right: 16px;
    padding: 8px 16px;
    background: var(--primary-green);
    color: var(--primary-black);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: 'SF Pro Rounded', sans-serif;
}

.install-pwa-button:active {
    transform: scale(0.95);
}

/* Home indicator для iOS */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 135px;
    height: 5px;
    background: var(--primary-black);
    border-radius: 100px;
    z-index: 9999;
}

/* Адаптивность */
@media (max-width: 375px) {
    .connection-button {
        width: 150px;
        height: 150px;
    }
    
    .connection-button-container::before {
        width: 180px;
        height: 180px;
    }
}

@media (min-width: 768px) {
    body {
        max-width: 375px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
}
