<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Заказ столика в ресторане</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="form-container">
<h1>Бронирование столика</h1>
<form>
<div class="field-group">
<label for="name">Имя</label>
<input type="text" id="name" name="name" required placeholder="Введите ваше имя">
</div>
<div class="field-group">
<label for="phone">Телефон</label>
<input type="tel" id="phone" name="phone" required placeholder="+7 (___) ___-__-__">
</div>
<div class="field-group">
<label for="datetime">Дата и время</label>
<input type="datetime-local" id="datetime" name="datetime" required>
</div>
<div class="field-group">
<label for="guests">Количество гостей</label>
<input type="number" id="guests" name="guests" min="1" max="20" required value="2">
</div>
<div class="field-group">
<label for="wishes">Пожелания</label>
<textarea id="wishes" name="wishes" rows="3" placeholder="Ваши пожелания к заказу"></textarea>
</div>
<button type="submit" class="submit-btn">Забронировать</button>
</form>
</div>
</body>
</html>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background-color: #f4f6f9;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.form-container {
background: #ffffff;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 450px;
}
h1 {
font-size: 24px;
margin-bottom: 20px;
color: #333;
text-align: center;
}
.field-group {
margin-bottom: 20px;
display: flex;
flex-direction: column;
}
label {
font-size: 14px;
font-weight: bold;
margin-bottom: 6px;
color: #555;
}
input, textarea {
width: 100%;
padding: 10px 12px;
border: 2px solid #ccc;
border-radius: 6px;
font-size: 14px;
outline: none;
transition: border-color 0.3s, box-shadow 0.3s;
}
/* Отклик на фокус */
input:focus, textarea:focus {
border-color: #007bff;
box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
}
/* CSS Валидация (без JS) */
input:user-invalid, textarea:user-invalid {
border-color: #dc3545;
}
input:user-valid, textarea:user-valid {
border-color: #28a745;
}
/* Интерактивная кнопка */
.submit-btn {
width: 100%;
padding: 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 6px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s, transform 0.1s;
}
.submit-btn:hover {
background-color: #0056b3;
}
.submit-btn:active {
transform: scale(0.98);
}