astro_avtourist/frontend/src/pages/auth/sign-in.astro
2026-04-06 21:28:31 +05:00

263 lines
6.8 KiB
Text

---
import Layout from '@layouts/Layout.astro';
import { SITE_URL } from '@constants';
---
<Layout
title="Вход в аккаунт"
description="Войдите в свой аккаунт для доступа к личному кабинету"
canonicalLink={`${SITE_URL}/auth/sign-in`}
>
<div class="auth-page">
<div class="auth-container">
<div class="auth-card">
<div class="auth-header">
<h1>Вход в аккаунт</h1>
<p>Введите свои данные для входа</p>
</div>
<form class="auth-form" id="sign-in-form">
<div class="form-group">
<label for="email">Email</label>
<input
type="email"
id="email"
name="email"
placeholder="example@mail.ru"
required
autocomplete="email"
/>
</div>
<div class="form-group">
<label for="password">Пароль</label>
<input
type="password"
id="password"
name="password"
placeholder="••••••••"
required
autocomplete="current-password"
/>
</div>
<div class="form-options">
<label class="checkbox-label">
<input type="checkbox" name="remember" />
<span>Запомнить меня</span>
</label>
<a href="#" class="forgot-link">Забыли пароль?</a>
</div>
<button type="submit" class="btn-submit">
Войти
</button>
</form>
<div class="auth-footer">
<p>Нет аккаунта? <a href="/auth/sig-up">Зарегистрироваться</a></p>
</div>
</div>
</div>
</div>
</Layout>
<style>
/* Основная страница */
.auth-page {
min-height: calc(100vh - 160px);
background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
display: flex;
align-items: center;
justify-content: center;
padding: 8rem 2rem 2rem;
}
.auth-container {
width: 100%;
max-width: 440px;
}
/* Карточка авторизации */
.auth-card {
background: #ffffff;
border-radius: 16px;
padding: 2rem 1.75rem;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
/* Заголовок */
.auth-header {
text-align: center;
margin-bottom: 1.5rem;
}
.auth-header h1 {
color: #1e3050;
font-size: 1.5rem;
font-weight: 800;
margin: 0 0 0.5rem 0;
letter-spacing: -0.02em;
}
.auth-header p {
color: #64748b;
font-size: 0.9rem;
margin: 0;
}
/* Форма */
.auth-form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.form-group label {
color: #1e3050;
font-size: 0.85rem;
font-weight: 600;
}
.form-group input {
padding: 0.7rem 0.9rem;
border: 1px solid #e2e8f0;
border-radius: 8px;
font-size: 0.95rem;
transition: all 0.2s ease;
background: #f8fafc;
}
.form-group input:focus {
outline: none;
border-color: #d4af37;
box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
background: #ffffff;
}
.form-group input::placeholder {
color: #94a3b8;
}
/* Опции формы */
.form-options {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.875rem;
}
.checkbox-label {
display: flex;
align-items: center;
gap: 0.5rem;
color: #64748b;
cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
width: 16px;
height: 16px;
accent-color: #d4af37;
cursor: pointer;
}
.forgot-link {
color: #d4af37;
text-decoration: none;
font-weight: 500;
transition: color 0.2s ease;
}
.forgot-link:hover {
color: #b8941f;
}
/* Кнопка отправки */
.btn-submit {
background: linear-gradient(135deg, #eac26e 0%, #ce9f40 100%);
color: #ffffff;
border: none;
border-radius: 8px;
padding: 1rem;
font-size: 1rem;
font-weight: 700;
cursor: pointer;
transition: all 0.3s ease;
margin-top: 0.5rem;
}
.btn-submit:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(206, 159, 64, 0.4);
}
.btn-submit:active {
transform: translateY(0);
}
/* Подвал формы */
.auth-footer {
text-align: center;
margin-top: 1.25rem;
padding-top: 1.25rem;
border-top: 1px solid #e2e8f0;
}
.auth-footer p {
color: #64748b;
font-size: 0.9rem;
margin: 0;
}
.auth-footer a {
color: #d4af37;
text-decoration: none;
font-weight: 600;
transition: color 0.2s ease;
}
.auth-footer a:hover {
color: #b8941f;
}
/* Адаптивность */
@media (max-width: 480px) {
.auth-card {
padding: 2rem 1.5rem;
}
.auth-header h1 {
font-size: 1.5rem;
}
.form-options {
flex-direction: column;
align-items: flex-start;
gap: 0.75rem;
}
}
</style>
<script>
// Обработка отправки формы
document.getElementById('sign-in-form')?.addEventListener('submit', async (e) => {
e.preventDefault();
const form = e.target as HTMLFormElement;
const formData = new FormData(form);
const email = formData.get('email') as string;
const password = formData.get('password') as string;
// Здесь будет логика отправки на сервер
console.log('Вход:', { email, password });
// Пример: await fetch('/api/auth/signin', { method: 'POST', body: JSON.stringify({ email, password }) });
});
</script>