/* Styles for index.php (login) */
:root {
    --br: #4f2f2b;
    --brd: #4A2C1A;
    --brm: #7B4F2E;
    --brw: #A0683A;
    --brl: #C8956C;
    --brp: #E8C9A8;
    --brmist: #F5EBE0;
    --brcream: #FBF6F0;
    --err: #A3271B;
    --err-bg: #FDF0EE;
    --err-line: #F1C6BF;
}

*, ::before, ::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: Jost, system-ui, sans-serif;
    color: var(--br);
    background: var(--brcream);
    -webkit-font-smoothing: antialiased;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Layout ---------- */
.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (min-width: 960px) {
    .login-shell { grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr); grid-template-rows: 1fr; }
}

/* ---------- Brand panel ---------- */
.login-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: var(--brd) url(../../welcome-bg.jpg) center / cover no-repeat;
}

.hero-video {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(20, 10, 6, .35) 0%, rgba(20, 10, 6, .1) 40%, rgba(20, 10, 6, .8) 100%),
        linear-gradient(90deg, rgba(79, 47, 43, .55), rgba(79, 47, 43, .15));
}

.hero-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    padding: 20px 16px 40px;
}

.hero-logo {
    width: auto;
    height: 32px;
    align-self: flex-start;
    filter: brightness(0) invert(1);
}

.hero-eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--brp);
}

.hero-title {
    margin: 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(28px, 6vw, 56px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.01em;
}

.hero-sub,
.hero-foot { display: none; }

@media (min-width: 960px) {
    .hero-content { padding: 40px 48px; justify-content: space-between; }
    .hero-video { display: block; }
    .hero-logo { height: 44px; }
    .hero-eyebrow { font-size: 12px; margin-bottom: 12px; }
    .hero-title { max-width: 14ch; }
    .hero-sub {
        display: block;
        margin: 16px 0 0;
        max-width: 42ch;
        font-size: 16px;
        font-weight: 300;
        line-height: 1.6;
        color: rgba(255, 255, 255, .82);
    }
    .hero-foot { display: block; margin: 0; font-size: 12px; color: rgba(255, 255, 255, .55); }
}

/* ---------- Sign-in panel ---------- */
.login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 0 16px 28px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    margin-top: -16px; /* tuck slightly under the banner on phones */
    position: relative;
    padding: 28px 22px;
    background: #fff;
    border: 1px solid rgba(232, 201, 168, .8);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(79, 47, 43, .1);
    animation: rise .45s ease-out both;
}

@media (min-width: 960px) {
    .login-panel { justify-content: center; padding: 48px; }
    .login-card {
        margin-top: 0;
        padding: 40px 36px;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.card-head { margin-bottom: 24px; }

.card-head h2 {
    margin: 0 0 6px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--br);
}

.card-head p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--brm);
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
}

.alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.alert-error { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err); }

.alert-notice { background: var(--brmist); border: 1px solid var(--brp); color: var(--brd); }
.alert-notice svg { color: var(--brw); }

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brd);
}

.input-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--brl);
    pointer-events: none;
    transition: color .15s;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font: 500 15px/1 Jost, system-ui, sans-serif;
    color: var(--br);
    background: var(--brcream);
    border: 1.5px solid var(--brp);
    border-radius: 12px;
    outline: 0;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

#password { padding-right: 48px; }

.input-wrap input::placeholder { color: var(--brl); font-weight: 400; }

.input-wrap input:hover { border-color: var(--brl); }

.input-wrap input:focus {
    background: #fff;
    border-color: var(--brw);
    box-shadow: 0 0 0 4px rgba(160, 104, 58, .15);
}

.input-wrap:focus-within .input-icon { color: var(--brm); }

.input-wrap input[aria-invalid="true"] { border-color: #D9786B; }
.input-wrap input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(163, 39, 27, .12); }

.toggle-pw {
    position: absolute;
    right: 4px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    transform: translateY(-50%);
    color: var(--brw);
    background: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: color .15s, background .15s;
}

.toggle-pw:hover { color: var(--br); background: var(--brmist); }
.toggle-pw:focus-visible { outline: 2px solid var(--brw); outline-offset: -2px; }
.toggle-pw svg { width: 19px; height: 19px; }
.toggle-pw .icon-eye-off,
.toggle-pw[aria-pressed="true"] .icon-eye { display: none; }
.toggle-pw[aria-pressed="true"] .icon-eye-off { display: block; }

.field-msg,
.field-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 7px 0 0;
    font-size: 12.5px;
    font-weight: 500;
}

.field-msg { color: var(--err); }
.field-hint { color: var(--brw); }
.field-hint svg { width: 14px; height: 14px; }
.field-msg[hidden], .field-hint[hidden] { display: none; }

/* ---------- Remember me ---------- */
.remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 24px;
    font-size: 14px;
    color: var(--brm);
    cursor: pointer;
    user-select: none;
}

.remember input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--br);
    cursor: pointer;
}

.remember:hover { color: var(--br); }

/* ---------- Submit ---------- */
.btn-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    font: 600 15px/1 Jost, system-ui, sans-serif;
    letter-spacing: .02em;
    color: #fff;
    background: var(--br);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(79, 47, 43, .25);
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .15s;
}

.btn-submit:hover:not(:disabled) {
    background: var(--brm);
    box-shadow: 0 10px 24px rgba(79, 47, 43, .3);
    transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) { transform: none; }
.btn-submit:focus-visible { outline: 3px solid var(--brl); outline-offset: 3px; }
.btn-submit:disabled { cursor: progress; opacity: .85; }

.btn-arrow { width: 18px; height: 18px; stroke-width: 2; transition: transform .15s; }
.btn-submit:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn-submit.is-loading .btn-arrow { display: none; }
.btn-submit.is-loading .btn-spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.card-help {
    margin: 20px 0 0;
    font-size: 13px;
    text-align: center;
    color: var(--brw);
}

.powered {
    margin: 0;
    font-size: 12px;
    color: var(--brl);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-video { display: none; }
    .login-card { animation: none; }
    *, ::before, ::after { transition-duration: 0s !important; }
}
