:root {
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2937;
    background: #f3f4f6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background: #f5f5f5;
}

.auth-page,
.app-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow-x: hidden;
}

#backSlideshow {
    position: fixed !important;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: -2;
    overflow: hidden;
    background: #f5f5f5;
    pointer-events: none;
    transform: translateZ(0);
}

#backSlideshow .bgM {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 1.6s ease-in-out;
    pointer-events: none;
    user-select: none;
}

#backSlideshow .bgM.is-active {
    opacity: 1;
}

/*
 * Optional per-image mobile horizontal position.
 * Add -mNN to a background filename, e.g. tyneandwear-m22.webp.
 * NN is the horizontal object-position percentage (0 = left, 50 = centre,
 * 100 = right). Desktop remains centred.
 */
@media (max-width: 760px) {
    #backSlideshow .bgM {
        object-position: var(--mobile-bg-x, 50%) center;
    }
}

.auth-card,
.page-shell {
    position: relative;
    z-index: 1;
}

.auth-card,
.page-shell {
    width: min(420px, 100%);
    padding: 28px;
    border-radius: 14px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 32px rgba(0,0,0,.16);
}

.page-shell {
    margin: 60px auto;
}

.auth-card h1,
.page-shell h1 {
    margin: 0 0 20px;
    text-align: center;
}

form {
    display: grid;
    gap: 14px;
}

label {
    font-weight: 700;
}

input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #c8ccd2;
    border-radius: 7px;
    font: inherit;
    background: #fffcc9;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid #777;
    border-radius: 20px;
    background: #f4f4f4;
    color: #111;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 3px rgba(0,0,0,.15);
    transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}

.btn:hover {
    transform: translateY(-1px);
    background: #e9e9e9;
    box-shadow: 0 3px 5px rgba(0,0,0,.18);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    width: 100%;
    border-radius: 7px;
    border-color: #0b74e5;
    background: #0b82f6;
    color: #fff;
}

.btn-primary:hover {
    background: #006fdc;
}

.auth-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 16px;
    font-size: 14px;
}

.auth-links a { color: #006fe6; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.message {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 14px;
}
.message.error { background: #fee2e2; border: 1px solid #fca5a5; }
.message.success { background: #dcfce7; border: 1px solid #86efac; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
    #backSlideshow .bgM { transition: none; }
}


/* -------------------------------------------------------------------------
 * Login screen
 * ---------------------------------------------------------------------- */

.auth-login-page {
    display: block;
    padding: 0;
}

.auth-login-card {
    position: fixed;
    top: 28svh;
    left: 50%;
    width: min(420px, calc(100% - 48px));
    transform: translate(-50%, -50%);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -28px -28px 20px;
    padding: 13px 18px;
    border-bottom: 1px solid #e1e1e1;
    border-radius: 14px 14px 0 0;
    background: rgba(247,247,247,.94);
}

.auth-brand img {
    display: block;
    width: 88px;
    max-width: 30vw;
    height: auto;
}

.auth-login-card h1 {
    margin-bottom: 18px;
}

@supports not (height: 1svh) {
    .auth-login-card {
        top: 28vh;
    }
}

@media (max-width: 600px) {
    .auth-login-card {
        width: min(420px, calc(100% - 28px));
    }

    .auth-brand img {
        width: 80px;
    }
}

input,
select,
textarea {
    font-weight: 400 !important;
}