/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html {
    height: 100%;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #1a1a1a;
}

body {
    margin: 0;
    min-height: 100vh;
    background: none;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* Background image — lives on ::after.
   The url() resolves relative to this CSS file, so login-background.png
   must sit in the same bucket folder as login.css. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('login-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    filter: grayscale(1);
    pointer-events: none;
}

/* Glass panel — right half */
body::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(6px);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* ── Live-template wrapper ──
   The deployed Tapestry template wraps the form in `.container` and emits its
   own logo block (#logo on an S3 image). `display: contents` removes the
   wrapper box so the form still takes part in the body grid directly, and we
   hide the original logo row — our own logo is injected by login.js. */
.container { display: contents; }
.container > .row { display: none; }

a { color: #fff; text-decoration: none; }
.buffer-top { margin-top: 14px; }

/* ── Bootstrap class replacements ── */
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.form-control { display: block; width: 100%; height: 36px; padding: 6px 12px; font-size: 14px; line-height: 1.5; color: #555; background-color: #fff; border: 1px solid #ccc; border-radius: 4px; }

/* ── Logo panel (injected by login.js) ── */
#logo-panel {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Form — right panel ── */
.form-signin {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 48px;
    position: relative;
    z-index: 1;
    max-width: none;
    width: auto;
    margin: 0;
}

/* ── Logo lockup ── */
#logo-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

#coreprint-logo {
    margin: 0 auto;
    max-width: 241px;
    width: 100%;
    height: auto;
    display: block;
}

#logo-tagline {
    font-family: "Open Sans", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

#vpress-logo {
    width: 78px;
    height: auto;
    vertical-align: -0.5em;
}

/* Desktop only — pin tagline to bottom-right of the logo panel */
@media (min-width: 769px) {
    #logo-tagline {
        position: absolute;
        right: 20px;
        bottom: 20px;
    }
}

/* ── Hide old overlay div ── */
#form-signin-background { display: none; }

/* ── Card ── */
#form-signin {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#form-signin h1 {
    font-family: "Poppins", sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
}

#form-signin p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    width: auto !important;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

#form-signin a { color: rgba(255, 255, 255, 0.85); }
#form-signin a:hover { color: #fff; }

#form-signin > div:last-child { padding-top: 10px !important; }

/* ── Inputs ── */
#form-signin input[type=text],
#form-signin input[type=password] {
    background-color: rgba(255, 255, 255, 0.92);
    color: #222;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.4;
    height: auto;
    margin-top: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

#form-signin input[type=text]:focus,
#form-signin input[type=password]:focus {
    outline: none;
    border-color: #f26c4f;
    box-shadow: 0 0 0 3px rgba(242, 108, 79, 0.25);
    background-color: #fff;
}

.form-control, .btn-primary { border: none; border-radius: 8px; }

/* ── Button ── */
.btn { border-radius: 8px; }

.btn.vpress {
    display: block;
    width: 100%;
    text-decoration: none;
    background: linear-gradient(135deg, #f26c4f, #e9530e);
    border: none;
    border-radius: 8px;
    color: #fff;
    text-align: center;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.15s ease, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn.vpress:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4); }
.btn.vpress:active { transform: translateY(0); }

.btn.vpress-black { background-color: #101010; border: none; color: #fff; }

/* ── Forgot password ── */
#forgotpass a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
    display: inline-block;
    padding: 6px 0;
}

#forgotpass a:hover { color: #fff; }

/* ── Mobile — single column ── */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-content: center;
    }

    body::before { width: 100%; border-left: none; }

    #logo-panel {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        min-height: auto;
        padding: 48px 24px 24px;
    }

    .form-signin {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
        min-height: auto;
        padding: 0 24px 72px;
    }

    /* Drop logo-panel out of the positioning context so the tagline can pin
       to the bottom of the page (body) rather than the logo panel. */
    #logo-panel { position: static; }

    /* Move "powered by vpress" beneath the glass card, at the foot of the page */
    #logo-tagline {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 24px;
        text-align: center;
    }

    #coreprint-logo { max-width: 150px; margin: 0 auto; }

    #form-signin h1 { font-size: 1.35rem; }

    #form-signin input[type=text],
    #form-signin input[type=password] { min-height: 44px; font-size: 16px; }

    .btn.vpress { min-height: 44px; }
}
