/**
 * Fast Delivery Platform
 * Yandex ID Style Login Page
 * Минималистичный дизайн с размытым фоном
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: url('../images/login-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

/* Предотвращение дублирования */
.login-container:not(:first-of-type) {
    display: none;
}

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

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.login-header {
    padding: 40px 40px 30px;
    text-align: center;
}

.login-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-title {
    font-size: 26px;
    font-weight: 500;
    color: #252525;
    margin-bottom: 12px;
}

.login-subtitle {
    font-size: 15px;
    color: #666;
    font-weight: 400;
}

.login-form {
    padding: 0 40px 40px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #252525;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #fafafa;
    color: #252525;
}

.form-input:hover {
    background: #ffffff;
    border-color: #ccc;
}

.form-input:focus {
    outline: none;
    border-color: #252525;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 37, 37, 0.1);
}

.form-input::placeholder {
    color: #aaa;
}

.user-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    background: #f5f5f5;
    padding: 6px;
    border-radius: 12px;
}

.user-type-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.25s ease;
}

.user-type-btn.active {
    background: #ffffff;
    color: #252525;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-login {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    background: #252525;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-login:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success {
    background: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.login-footer {
    text-align: center;
    padding: 0 40px 32px;
}

.login-link {
    color: #252525;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #999;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.divider::before { margin-right: 15px; }
.divider::after { margin-left: 15px; }

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #252525;
}

.checkbox-group label {
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #999;
}

.input-wrapper .form-input {
    padding-left: 46px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
}

.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

.page-footer-content {
    pointer-events: auto;
}

.page-footer-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.page-footer-link {
    font-size: 13px;
    color: #ffffff;
    text-decoration: none;
    opacity: 0.9;
}

@media (max-width: 480px) {
    body { padding: 15px; }
    .login-card { border-radius: 20px; }
    .login-header { padding: 30px 24px 20px; }
    .login-logo { width: 80px; height: 80px; border-radius: 16px; }
    .login-title { font-size: 22px; }
    .login-form { padding: 0 24px 30px; }
    .form-input { padding: 13px 14px; font-size: 14px; border-radius: 8px; }
    .btn-login { padding: 14px; font-size: 15px; border-radius: 10px; }
    .login-footer { padding: 0 24px 26px; }
}

.btn-login.loading {
    color: transparent;
    pointer-events: none;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
