/*
 * Width shared by the page cards and the flash block above them, so the two
 * cannot drift apart and leave the message misaligned with the content.
 */
:root {
    --content-width: 22rem;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    font-family: system-ui, sans-serif;
}

.page {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    box-sizing: border-box;
}

/*
 * Flash messages sit above the content, matching its width. Placement only —
 * the cards' own styling is untouched and waits for the consistency pass after
 * S-04.
 */
.flash {
    width: 100%;
    max-width: var(--content-width);
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    box-sizing: border-box;
}

.flash-success {
    background-color: #dcfce7;
    color: #166534;
}

.flash-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.login-card,
.home-card {
    width: 100%;
    max-width: var(--content-width);
    padding: 2rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.login-card h1 {
    margin-top: 0;
    font-size: 1.25rem;
}

.login-card .form-row {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.login-card button {
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-radius: 0.25rem;
    background-color: #2563eb;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.login-card button:hover {
    background-color: #1d4ed8;
}

.login-error {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 0.25rem;
}

/*
 * `profile-clear` confirmation page. The card itself is the shared
 * `.login-card`; these rules only cover what that card has never had to show
 * before — a list of what is about to be deleted, and a destructive action.
 */
.clear-fields {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    line-height: 1.6;
}

.clear-irreversible {
    font-weight: 600;
    color: #991b1b;
}

/*
 * The destructive action must not read as a peer of the way out. The button
 * carries the weight; cancel is a plain link.
 */
.login-card button.danger {
    background-color: #b91c1c;
}

.login-card button.danger:hover {
    background-color: #991b1b;
}

.clear-cancel {
    margin-bottom: 0;
    text-align: center;
}
