/* Медицинский Бот - Основные стили */

:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --accent-color: #FF3B30;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --background-primary: #F2F2F7;
    --background-secondary: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 16px 64px rgba(0, 0, 0, 0.15);
    --border-radius: 20px;
    --border-radius-small: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    height: 100vh;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    width: 100vw;
    padding-bottom: 100px; /* Отступ для футера */
}

/* Анимированный сине-зеленый градиент */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, 
        #1e40af 0%, 
        #3b82f6 15%, 
        #60a5fa 30%, 
        #93c5fd 45%, 
        #dbeafe 60%, 
        #d1fae5 75%, 
        #6ee7b7 90%, 
        #10b981 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
}

/* Плавные орбы */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: smoothFloat 12s ease-in-out infinite;
    opacity: 0.6;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(96, 165, 250, 0.3) 50%, rgba(147, 197, 253, 0.2) 100%);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(110, 231, 183, 0.4) 50%, rgba(209, 250, 229, 0.2) 100%);
    top: 40%;
    right: 15%;
    animation-delay: 4s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(16, 185, 129, 0.3) 50%, rgba(96, 165, 250, 0.2) 100%);
    bottom: 15%;
    left: 30%;
    animation-delay: 8s;
}

/* Анимированные частицы */
.medical-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: particleFloat 12s linear infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.particle:nth-child(1) { left: 5%; animation-delay: 0s; }
.particle:nth-child(2) { left: 12%; animation-delay: 1s; }
.particle:nth-child(3) { left: 20%; animation-delay: 2s; }
.particle:nth-child(4) { left: 28%; animation-delay: 3s; }
.particle:nth-child(5) { left: 35%; animation-delay: 4s; }
.particle:nth-child(6) { left: 42%; animation-delay: 5s; }
.particle:nth-child(7) { left: 50%; animation-delay: 6s; }
.particle:nth-child(8) { left: 58%; animation-delay: 7s; }
.particle:nth-child(9) { left: 65%; animation-delay: 8s; }
.particle:nth-child(10) { left: 72%; animation-delay: 9s; }
.particle:nth-child(11) { left: 80%; animation-delay: 10s; }
.particle:nth-child(12) { left: 87%; animation-delay: 11s; }
.particle:nth-child(13) { left: 95%; animation-delay: 0.5s; }
.particle:nth-child(14) { left: 15%; animation-delay: 1.5s; }
.particle:nth-child(15) { left: 25%; animation-delay: 2.5s; }
.particle:nth-child(16) { left: 45%; animation-delay: 3.5s; }
.particle:nth-child(17) { left: 55%; animation-delay: 4.5s; }
.particle:nth-child(18) { left: 75%; animation-delay: 5.5s; }
.particle:nth-child(19) { left: 85%; animation-delay: 6.5s; }
.particle:nth-child(20) { left: 8%; animation-delay: 7.5s; }

/* Дополнительные анимированные элементы */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: shapeFloat 20s linear infinite;
}

.shape-1 {
    width: 20px;
    height: 20px;
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.shape-2 {
    width: 15px;
    height: 15px;
    top: 30%;
    right: 25%;
    animation-delay: 5s;
}

.shape-3 {
    width: 25px;
    height: 25px;
    top: 60%;
    left: 15%;
    animation-delay: 10s;
}

.shape-4 {
    width: 18px;
    height: 18px;
    bottom: 30%;
    right: 20%;
    animation-delay: 15s;
}

.shape-5 {
    width: 22px;
    height: 22px;
    top: 45%;
    left: 60%;
    animation-delay: 8s;
}

/* Пульсирующие точки */
.pulse-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pulse-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: pulseDot 3s ease-in-out infinite;
}

.pulse-dot:nth-child(1) { top: 25%; left: 30%; animation-delay: 0s; }
.pulse-dot:nth-child(2) { top: 40%; right: 30%; animation-delay: 1s; }
.pulse-dot:nth-child(3) { bottom: 35%; left: 40%; animation-delay: 2s; }
.pulse-dot:nth-child(4) { top: 55%; right: 40%; animation-delay: 0.5s; }
.pulse-dot:nth-child(5) { bottom: 50%; left: 60%; animation-delay: 1.5s; }

/* Волновые эффекты */
.wave-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: waveExpand 8s ease-out infinite;
}

.wave-1 {
    top: -50%;
    left: -50%;
    animation-delay: 0s;
}

.wave-2 {
    top: -50%;
    left: -50%;
    animation-delay: 2s;
}

.wave-3 {
    top: -50%;
    left: -50%;
    animation-delay: 4s;
}


/* Плавные анимации */
@keyframes smoothFloat {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.6;
    }
    25% { 
        transform: translateY(-20px) translateX(15px) scale(1.05);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-40px) translateX(0px) scale(1.1);
        opacity: 0.8;
    }
    75% { 
        transform: translateY(-20px) translateX(-15px) scale(1.05);
        opacity: 0.7;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes shapeFloat {
    0% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.1;
    }
    25% {
        transform: translateY(-30px) translateX(20px) rotate(90deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-60px) translateX(0px) rotate(180deg);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-30px) translateX(-20px) rotate(270deg);
        opacity: 0.3;
    }
    100% {
        transform: translateY(0px) translateX(0px) rotate(360deg);
        opacity: 0.1;
    }
}

@keyframes pulseDot {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.3;
    }
}

@keyframes waveExpand {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* Основной контейнер */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Glass карточка */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-medium);
    max-width: 450px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* Логотип секция */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    margin-top: 5px;
}

/* Форма авторизации */
.auth-form {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.glass-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-small);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 400;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.glass-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.6;
}

/* Кнопка */
.glass-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--border-radius-small);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
}

.glass-button:active {
    transform: translateY(0);
}

.glass-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    transition: var(--transition);
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Особенности */
.features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-small);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.feature-item span {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Футер */
.footer {
    margin-top: 30px;
    text-align: center;
}

.footer p {
    color: #4a5568;
    font-size: 0.85rem;
    font-weight: 400;
}

/* Адаптивность для iPhone 17 и мобильных устройств */
@media (max-width: 768px) {
    html, body {
        margin: 0;
        padding: 0;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        background: linear-gradient(135deg, 
            #1e40af 0%, 
            #3b82f6 15%, 
            #60a5fa 30%, 
            #93c5fd 45%, 
            #dbeafe 60%, 
            #d1fae5 75%, 
            #6ee7b7 90%, 
            #10b981 100%);
        background-size: 400% 400%;
        animation: gradientShift 15s ease infinite;
        background-attachment: fixed;
    }
    
    .background {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        margin: 0;
        padding: 0;
        z-index: -1;
    }
    
    .container {
        padding: 0;
        margin: 0;
        min-height: 100vh;
        height: 100vh;
        width: 100vw;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .glass-card {
        padding: 20px 15px;
        margin: 0;
        width: calc(100vw - 20px);
        max-width: 400px;
        box-sizing: border-box;
    }
    
    .logo-text {
        font-size: 1.6rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
}

/* Специальные стили для iPhone 17 и маленьких экранов */
@media (max-width: 480px) {
    html, body {
        margin: 0;
        padding: 0;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        padding: 0;
        margin: 0;
        min-height: 100vh;
        height: 100vh;
        width: 100vw;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .glass-card {
        padding: 15px 12px;
        margin: 0;
        width: calc(100vw - 16px);
        max-width: 350px;
        box-sizing: border-box;
    }
    
    .logo {
        flex-direction: column;
        gap: 8px;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .glass-input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .glass-btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 15px;
    }
    
    .feature-item {
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* Дополнительные стили для iPhone 17 Pro Max и больших экранов */
@media (max-width: 430px) and (max-height: 932px) {
    .glass-card {
        width: calc(100vw - 12px);
        padding: 12px 10px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
}

/* Стили для страницы ошибки */
.error-content {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.error-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.error-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Анимации появления */
.glass-card {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: var(--shadow-light);
    z-index: 1000;
    transform: translateX(100%);
    transition: var(--transition);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--accent-color);
}

/* Telegram Login Widget стили */
.telegram-login-section {
    margin: 24px 0;
}

.login-methods {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.telegram-widget-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

.telegram-info {
    text-align: center;
    margin: 20px auto 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-small);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 100%;
}

.telegram-info p {
    margin: 8px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.telegram-info p:first-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Стили для формы авторизации */
.auth-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.glass-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 400;
    transition: var(--transition);
    outline: none;
}

.glass-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.glass-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.glass-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: var(--border-radius-small);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.glass-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.glass-button:active:not(:disabled) {
    transform: translateY(0);
}

.glass-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-loader {
    display: none;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .telegram-login-section {
        margin: 20px 0;
    }
    
    .login-methods {
        gap: 16px;
    }
    
    .telegram-widget-container {
        min-height: 50px;
    }
    
    .telegram-info {
        margin-top: 16px;
        padding: 12px;
    }
    
    .telegram-info p {
        font-size: 13px;
    }
    
    .auth-form {
        max-width: 320px;
    }
    
    .glass-input {
        padding: 14px 18px 14px 45px;
        font-size: 15px;
    }
    
    .glass-button {
        padding: 14px 20px;
        font-size: 15px;
    }
}
