* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--canvas);
    color: var(--ink);
}

::selection {
    background: var(--selection);
    color: var(--ink);
}

[hidden] {
    display: none !important;
}

/* ---------- top band ---------- */

.top-image {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
}

.top-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 55%;
    display: block;
}

.top-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 62%, var(--field-top));
    pointer-events: none;
}

/* ---------- login ---------- */

main {
    flex: 1;
    padding: 2rem 1.25rem 3rem;
    text-align: center;
    background: linear-gradient(to bottom, var(--field-top), var(--field-bottom) 45%, var(--canvas));
}

.lily-mark {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
    color: var(--leaf);
}

h1 {
    margin: 0;
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    line-height: 1.2;
    color: var(--leaf);
}

.subtitle {
    margin: 0.35rem 0 0;
    color: var(--ink-2);
}

form {
    max-width: 20rem;
    margin: 2rem auto 0;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--ink);
}

.password-field {
    position: relative;
}

.reveal-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    width: auto;
    margin: 0;
    padding: 0.4rem 0.65rem;
    transform: translateY(-50%);
    border-radius: 8px;
    background: transparent;
    color: var(--leaf);
    font-size: 0.9rem;
    font-weight: 600;
}

.reveal-toggle:hover {
    background: var(--surface-tint);
}

input {
    width: 100%;
    padding: 0.7rem 5rem 0.7rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:hover {
    border-color: var(--leaf-soft);
}

input:focus-visible {
    outline: none;
    border-color: var(--leaf);
    box-shadow: 0 0 0 3px var(--selection);
}

input[aria-invalid="true"] {
    border-color: var(--danger);
}

input[aria-invalid="true"]:focus-visible {
    box-shadow: 0 0 0 3px var(--danger-line);
}

.error-msg {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--danger-ink);
}

button {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 10px;
    background: var(--leaf);
    color: var(--surface);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background: var(--leaf-hover);
}

button:focus-visible {
    outline: 2px solid var(--leaf);
    outline-offset: 2px;
}

/* ---------- footer ---------- */

footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 0.6rem;
    margin: 0 auto;
    width: min(100% - 2rem, 736px);
    padding: 1.25rem 0 1.75rem;
    border-top: 1px solid var(--footer-line);
    background: transparent;
    color: var(--ink-3);
    font-size: 0.85rem;
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--leaf);
    font-weight: 600;
}

.footer-brand img {
    width: 1.1rem;
    height: 1.1rem;
}

.footer-sep {
    color: var(--line-hover);
}

@media (max-width: 600px) {
    .footer-sep {
        display: none;
    }
    footer {
        flex-direction: column;
    }
    .top-image {
        height: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }
}
