/* Login: the church at night with its windows lit, and the form rising from below it (phones)
   or standing beside it (larger screens). Same Marian blue, gold and night-blue as the app. */
:root {
    --lg-night: #0F1F38;
    --lg-night-top: #1E3A66;
    --lg-ink: #18212F;
    --lg-muted: #5D6878;
    --lg-faint: #8A94A3;
    --lg-field: #CBD3E0;
    --lg-surface: #F6F8FB;
    --lg-marian: #1F4E8C;
    --lg-marian-strong: #173B6B;
    --lg-gold: #A8781C;
    --lg-gold-bright: #D9AE52;
    --lg-window: #F7941E;
    --lg-bad: #B42318;
    --lg-bad-soft: #FDECEA;
    --lg-display: "Noto Kufi Arabic", "Cairo", sans-serif;
    --lg-body: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--lg-night);
    color: var(--lg-ink);
    font: 16px/1.6 var(--lg-body);
    -webkit-font-smoothing: antialiased;
}

.lg {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- the church ---------- */
.lg-hero {
    position: relative;
    flex: none;
    display: flex;
    flex-direction: column;
    padding: calc(20px + env(safe-area-inset-top)) 20px 0;
    background: radial-gradient(120% 75% at 50% 0%, var(--lg-night-top) 0%, #142B50 45%, var(--lg-night) 100%);
    color: #fff;
    overflow: hidden;
}

.lg-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lg-logo {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}

.lg-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.lg-brand-text {
    display: grid;
    line-height: 1.45;
}

.lg-brand-text strong {
    font: 700 16px/1.5 var(--lg-display);
}

.lg-brand-text small {
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-gold-bright);
}

.lg-tagline {
    display: none;
}

/* warm light spills from the windows onto the night around the church */
.lg-art {
    position: relative;
    width: min(100%, 460px);
    margin: 14px auto -46px;
}

.lg-art::before {
    content: "";
    position: absolute;
    inset: 22% -12% -8%;
    background: radial-gradient(closest-side, rgba(247, 148, 30, .28), rgba(247, 148, 30, 0));
    pointer-events: none;
}

.lg-art img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 14px rgba(247, 148, 30, .22));
    animation: lg-light 1.1s ease-out both;
}

/* ---------- the form ---------- */
.lg-panel {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
    background: #fff;
    box-shadow: 0 -18px 40px rgba(5, 12, 26, .35);
    animation: lg-rise .5s cubic-bezier(.2, .8, .3, 1) both;
}

.lg-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.lg-eyebrow {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--lg-gold);
}

.lg-title {
    margin: 0;
    font: 700 26px/1.5 var(--lg-display);
    color: var(--lg-marian-strong);
}

.lg-sub {
    margin: 2px 0 20px;
    font-size: 14px;
    color: var(--lg-muted);
}

.lg-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--lg-bad-soft);
    color: var(--lg-bad);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    animation: lg-shake .35s ease-out;
}

.lg-error[hidden] {
    display: none;
}

.lg-error svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lg-field {
    display: block;
    margin-bottom: 14px;
}

.lg-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--lg-ink);
}

.lg-control {
    position: relative;
    display: block;
}

.lg-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    fill: none;
    stroke: var(--lg-faint);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: stroke .15s;
}

/* 16px keeps iOS from zooming into the field */
.lg-control input {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 48px 0 16px;
    border: 1.5px solid var(--lg-field);
    border-radius: 14px;
    background: var(--lg-surface);
    color: var(--lg-ink);
    font: 600 16px var(--lg-body);
    outline: none;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}

.lg-control input[type="password"],
.lg-control input#Password {
    padding-left: 52px;
}

.lg-control input:focus {
    border-color: var(--lg-marian);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(31, 78, 140, .14);
}

.lg-control input:focus ~ .lg-icon,
.lg-control:focus-within .lg-icon {
    stroke: var(--lg-marian);
}

.lg-field.is-invalid input {
    border-color: var(--lg-bad);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .1);
}

.lg-eye {
    position: absolute;
    top: 50%;
    left: 6px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--lg-faint);
    cursor: pointer;
}

.lg-eye:hover {
    color: var(--lg-marian);
    background: rgba(31, 78, 140, .06);
}

.lg-eye svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lg-eye .off,
.lg-eye[aria-pressed="true"] .on {
    display: none;
}

.lg-eye[aria-pressed="true"] .off {
    display: block;
}

.lg-caps {
    margin: -6px 2px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-gold);
}

.lg-caps[hidden] {
    display: none;
}

.lg-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 56px;
    margin-top: 8px;
    border: 0;
    border-radius: 14px;
    background: var(--lg-marian);
    color: #fff;
    font: 700 17px var(--lg-display);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(31, 78, 140, .28);
    transition: background-color .15s, transform .1s;
}

.lg-submit:hover {
    background: var(--lg-marian-strong);
}

.lg-submit:active {
    transform: translateY(1px);
}

.lg-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lg-submit[aria-busy="true"] {
    opacity: .75;
    cursor: progress;
}

.lg-submit[aria-busy="true"] svg {
    animation: lg-nudge .8s ease-in-out infinite;
}

.lg-help {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--lg-muted);
    text-align: center;
}

.lg-eye:focus-visible,
.lg-submit:focus-visible {
    outline: 3px solid var(--lg-gold-bright);
    outline-offset: 2px;
}

/* ---------- motion ---------- */
@keyframes lg-light {
    from { opacity: 0; transform: translateY(10px); filter: drop-shadow(0 0 0 rgba(247, 148, 30, 0)) brightness(.7); }
    to { opacity: 1; transform: none; filter: drop-shadow(0 0 14px rgba(247, 148, 30, .22)) brightness(1); }
}

@keyframes lg-rise {
    from { transform: translateY(24px); opacity: .6; }
    to { transform: none; opacity: 1; }
}

@keyframes lg-shake {
    0%, 100% { transform: none; }
    25% { transform: translateX(-5px); }
    60% { transform: translateX(4px); }
}

@keyframes lg-nudge {
    0%, 100% { transform: none; }
    50% { transform: translateX(-4px); }
}

/* short phones: keep the form on screen with the keyboard open */
@media (max-height: 640px) and (max-width: 1023.98px) {
    .lg-art {
        width: min(78%, 360px);
        margin-bottom: -34px;
    }
}

/* ---------- larger screens: the church on the right, the form on the left ---------- */
@media (min-width: 1024px) {
    /* one screen tall, so the church can take whatever height the brand and the tagline leave */
    .lg {
        flex-direction: row;
        height: 100vh;
        height: 100dvh;
        min-height: 560px;
    }

    .lg-hero {
        flex: 1 1 auto;
        min-width: 0;
        padding: 36px 48px 0;
    }

    .lg-logo {
        width: 52px;
        height: 52px;
        border-radius: 15px;
    }

    .lg-logo img {
        width: 40px;
        height: 40px;
    }

    .lg-brand-text strong {
        font-size: 18px;
    }

    .lg-tagline {
        display: block;
        position: relative;
        z-index: 1;
        max-width: 15em;
        margin: 28px 0 0;
        font: 700 28px/1.75 var(--lg-display);
        color: #fff;
        text-wrap: balance;
    }

    .lg-art {
        flex: 1 1 0;
        min-height: 0;
        width: 100%;
        max-width: 1100px;
        margin: 20px auto 0;
        background: radial-gradient(48% 42% at 50% 88%, rgba(247, 148, 30, .24), rgba(247, 148, 30, 0) 100%);
    }

    .lg-art::before {
        content: none;
    }

    .lg-art img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: 50% 100%;
    }

    .lg-panel {
        flex: 0 0 min(500px, 44vw);
        justify-content: center;
        overflow-y: auto;
        padding: 48px;
        border-radius: 0;
        box-shadow: 18px 0 50px rgba(5, 12, 26, .35);
        animation: none;
    }

    .lg-form {
        max-width: 380px;
    }

    .lg-title {
        font-size: 30px;
    }
}

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