* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #222;
}

.auth-container {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.auth-container > h1 {
    text-align: center;
    margin-bottom: 8px;
}

.auth-container > p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

section h2 {
    margin-bottom: 20px;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 6px;
    font-weight: 600;
}

input {
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

input:focus {
    outline: 2px solid #333;
    outline-offset: 1px;
}

button {
    padding: 12px 18px;
    border: none;
    border-radius: 6px;
    background: #222;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #444;
}

section > p {
    margin-top: 18px;
    text-align: center;
}

section > p button {
    background: none;
    color: #222;
    padding: 0;
    font-weight: 600;
    text-decoration: underline;
}

section > p button:hover {
    background: none;
}

.message {
    min-height: 20px;
    margin-top: 12px;
}

[hidden] {
    display: none;
}

/* Contacts Page */

.contacts-page {
    display: block;
    padding: 40px 20px;
}

.contacts-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.contacts-header h1 {
    margin-bottom: 5px;
}

.contacts-header p {
    color: #666;
}

.contact-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.contact-controls input {
    flex: 1;
    margin-bottom: 0;
}

.contact-controls button {
    white-space: nowrap;
}

#addContactSection {
    margin-bottom: 30px;
    padding: 25px;
    background: #f4f6f8;
    border-radius: 8px;
}

#addContactSection h2 {
    margin-bottom: 20px;
}

#cancelAddButton {
    margin-top: 10px;
    background: #666;
}

#contactsList {
    margin-top: 15px;
}

.contact-card {
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.contact-card h3 {
    margin-bottom: 8px;
}

.contact-card p {
    margin: 4px 0;
    color: #555;
}