/*
 * Login page styles. Extracted from the inline <style> that used to live in templates/login.html:
 * kept there the pre-form HTML was ~13.6 KB (this CSS plus two inline brand SVGs), past Tomcat's
 * 8 KB response buffer, so the response committed before Thymeleaf reached the CSRF <form> — and a
 * render with no pre-existing session then threw "Cannot create a session after the response has
 * been committed". Serving the CSS (and the SVGs) as external static assets under /css/** (permit-all
 * in DefaultSecurityConfig) shrinks the pre-form HTML to well under the buffer, so the deferred CSRF
 * token is materialised before commit in every case.
 *
 * Copied verbatim from the SPA's register page (customer-portal-ui src/styles/register.css) so this
 * server-rendered login matches it one-to-one.
 */
:root {
    --white: #f8f6f5;
    --light: #f2ebe3;
    --dark: #272727;
    --accent: #d8a46b;
    --brown: rgba(84, 59, 45, 1);
    --error: #b4453c;
    --success: #3f7a4d;
    --radius: 3px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--light);
    color: var(--dark);
    font-family: "Epilogue", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.register {
    width: 100%;
    max-width: 1200px;
    padding: 4.5rem 1.25rem 3rem;
}

/* Brand / logo */
.brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.brand__logo {
    width: 96px;
    height: auto;
}

.brand__wordmark {
    display: block;
    width: 300px;
    max-width: 90%;
    height: auto;
    margin: 0.85rem auto 0;
}

/* Title */
.register__title {
    margin: 0 0 1.75rem;
    text-align: center;
    font-size: 3.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Form layout */
.register__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* Text inputs */
.field__input {
    width: 100%;
    padding: 1rem 1.1rem;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--dark);
    background: var(--white);
    border: 0;
    border-radius: var(--radius);
    outline: none;
    box-shadow: 0 0 0 0 transparent;
    transition: box-shadow 0.15s ease;
}

.field__input::placeholder {
    color: var(--dark);
}

.field__input:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

/* Submit button */
.register__submit {
    margin-top: 0.25rem;
    padding: 1.05rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--dark);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.register__submit:hover {
    opacity: 0.9;
}

/* Inline error message */
.register__error {
    margin: 0;
    padding: 0.95rem 1.1rem;
    font-size: 1.05rem;
    color: var(--error);
    background: transparent;
    border: 1px solid var(--error);
    border-radius: var(--radius);
}

/* Sign-out confirmation — mirrors the error box in the success colour */
.register__info {
    margin: 0;
    padding: 0.95rem 1.1rem;
    font-size: 1.05rem;
    color: var(--success);
    background: transparent;
    border: 1px solid var(--success);
    border-radius: var(--radius);
}

/* Accessibility helper */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
