/* ============================================================
   ROOT & БАЗА
   ============================================================ */
:root {
    --bg-start: #F8F4F1;
    --bg-end: #F0E9F5;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --accent: #7C6FFF;
    --accent-hover: #6A5EE8;
    --accent-secret: #FF8A8A;
    --text-primary: #2D2A32;
    --text-secondary: #6B6570;
    --radius-lg: 48px;
    --radius-md: 20px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(145deg, var(--bg-start), var(--bg-end));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 540px;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 28px 24px 32px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    position: relative;
    min-height: 600px;
    transition: all 0.3s ease;
}

.hidden {
    display: none !important;
}

/* ============================================================
   ХЕДЕР
   ============================================================ */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.logo {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-banner {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 30px;
    background: rgba(124, 111, 255, 0.12);
    border: 1px solid rgba(124, 111, 255, 0.2);
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-banner:hover {
    background: rgba(124, 111, 255, 0.2);
    transform: translateY(-2px);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.5);
}
.status-indicator.online {
    background: #5EC8A3;
}
.status-indicator.offline {
    background: #E87B7B;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ============================================================
   СЕТКА ИКОНОК (Glassmorphism)
   ============================================================ */
.desktop {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0 24px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    background: none;
    padding: 0;
}

.desktop-icon:hover .icon-circle {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(124, 111, 255, 0.15);
}

.desktop-icon .icon-circle {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.25s ease;
}

.desktop-icon .icon-circle.secret-glow {
    border-color: rgba(255, 138, 138, 0.4);
    box-shadow: 0 0 20px rgba(255, 138, 138, 0.15);
}

.desktop-icon span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}

.footer-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 8px;
}

/* ============================================================
   ЭКРАН СЕКЦИИ
   ============================================================ */
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.back-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--accent);
    cursor: pointer;
    padding: 4px 8px;
}

/* ============================================================
   АВТОРИЗАЦИЯ
   ============================================================ */
#authSection {
    text-align: center;
    padding: 20px 0;
}

#authSection .auth-header {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

#authSection .sub {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

#authSection input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    transition: border 0.3s ease;
}

#authSection input:focus {
    outline: none;
    border-color: var(--accent);
}

#authSection button {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

#authSection button:hover {
    background: var(--accent-hover);
}

.toggle-auth {
    margin-top: 14px;
    font-size: 14px;
    color: var(--accent);
    cursor: pointer;
}

.error {
    color: #E87B7B;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ============================================================
   ЭКРАН ЗВОНКА / ВИДЕО
   ============================================================ */
.call-screen,
.video-screen {
    text-align: center;
    padding: 40px 0;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.call-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
}

.call-btn.hangup {
    background: #E87B7B;
    color: #fff;
}

.call-btn:hover {
    transform: scale(1.05);
}

#callTimer {
    font-size: 32px;
    font-weight: 300;
    color: var(--text-primary);
    margin: 12px 0;
}

#callerName {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 480px) {
    .container {
        padding: 20px 16px 24px;
        border-radius: 32px;
        min-height: 500px;
    }
    .desktop {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    .desktop-icon .icon-circle {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    .desktop-icon span {
        font-size: 12px;
    }
    .logo {
        font-size: 18px;
    }
}

@media (max-width: 400px) {
    .desktop {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}