:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --background: #f9fafb;
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--shadow-color);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 7px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.login-logo {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo h1 {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group .input-with-icon {
    position: relative;
}

.form-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-dark);
    background-color: #f9fafb;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    outline: none;
    background-color: white;
}

.error-message {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    border-left: 4px solid var(--danger-color);
}

.error-message i {
    margin-right: 10px;
    font-size: 16px;
}

.login-button {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.login-button:active {
    transform: scale(0.98);
}

.login-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0) 100%);
    transition: left 0.7s ease;
}

.login-button:hover::after {
    left: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 35px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.back-link a i {
    margin-right: 6px;
}

.back-link a:hover {
    color: var(--primary-dark);
    transform: translateX(-3px);
}

.otp-info {
    background-color: rgba(99, 102, 241, 0.08);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
    border-left: 4px solid var(--primary-color);
}

.otp-digits {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    gap: 10px;
}

.otp-digits input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

.otp-digits input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    outline: none;
    background-color: white;
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-container {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
        box-shadow: 0 5px 15px var(--shadow-color);
    }
    
    .form-group input {
        padding: 12px 14px 12px 42px;
    }
    
    .login-button {
        padding: 12px 16px;
    }
    
    .login-logo h1 {
        font-size: 28px;
    }
    
    .otp-digits input {
        width: 40px;
        height: 50px;
        font-size: 20px;
    }
}

/* Специфичные стили для iPhone Pro Max и других устройств с большим экраном */
@media only screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) {
    body {
        background: #f3f4f6;
    }
    
    .login-container {
        transform: none !important;
        -webkit-transform: none !important;
        transition: none !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        border-radius: 20px;
    }
    
    .login-container:hover {
        transform: none !important;
        -webkit-transform: none !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .form-group input, 
    .login-button {
        transform: none !important;
        -webkit-transform: none !important;
        transition: none !important;
    }
}