/* Login: church photo on top, navy panel below, sign-in steps on a white card.
   A global stylesheet rather than scoped CSS: the classes are shared by LoginFrame,
   LoginSetupFlow and LoginQuickUnlock, and scoped styles don't cross components.
   Colours are fixed rather than theme tokens - the card stays white and crisp in dark mode too,
   since this is the one screen every member uses every day. Gold comes from the trim around
   the church's arched windows. */

.login {
    --navy: #14357E;
    --navy-deep: #0A1E4A;
    --ink: #0F1F44;
    --gold: #F2C14E;
    --gold-ring: #D9A21B;

    flex: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--navy) 0%, #0E2A66 55%, var(--navy-deep) 100%);
}

/* ---------- church photo ---------- */
/* The photo takes whatever height the card leaves over: about half the screen on the resting
   unlock screen, a strip when a keypad is up. */
.login__hero {
    position: relative;
    flex: 1 0 auto;
    min-height: 200px;
    overflow: hidden;
    background: #9DB6E8;   /* the photo's sky, while it loads */
}

.login__hero img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 40% 42%;   /* keeps the tower and its "Kakkanad" sign in frame */
}

/* Top: keeps the phone's status bar legible. Bottom: melts the photo into the navy panel. */
.login__hero::before,
.login__hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}

.login__hero::before {
    top: 0;
    height: calc(56px + var(--safe-top));
    background: linear-gradient(to bottom, rgba(5, 15, 40, .35), rgba(5, 15, 40, 0));
}

.login__hero::after {
    bottom: 0;
    height: 30%;   /* a shorter fade, so more of the church front stays clear */
    background: linear-gradient(to bottom, rgba(20, 53, 126, 0) 0%, rgba(20, 53, 126, .55) 65%, var(--navy) 100%);
}

.login--compact .login__hero { min-height: 120px; }
.login--compact .login__hero img { object-position: 40% 30%; }   /* short strip: favour the tower sign */

/* ---------- navy panel + church name ---------- */
.login__panel {
    position: relative;
    z-index: 1;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -40px;
    padding: 0 16px calc(14px + var(--safe-bottom));
}

.login__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
}

/* The emblem sits on the seam between photo and panel. */
.login__emblem {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .22), 0 8px 20px rgba(3, 12, 40, .35);
    transition: width .3s ease, height .3s ease;
}

.login__emblem img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.login__church {
    margin: 7px 0 0;
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: #fff;
}

.login__place {
    margin-top: 1px;
    padding-left: .34em;   /* balances the letter-spacing so the word stays centred */
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--gold);
}

.login__diocese {
    margin-top: 1px;
    font-size: .78rem;
    color: #B4C6EE;
}

.login__names {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login--compact .login__emblem { width: 66px; height: 66px; }
.login--compact .login__emblem img { width: 46px; height: 46px; }
.login--compact .login__church { margin-top: 8px; font-size: 1.2rem; }
.login--compact .login__diocese { display: none; }

/* Short phones (iPhone SE and similar) on the keypad screens: a thinner photo strip and the
   emblem beside the name, so photo, name, PIN boxes and keypad all fit without scrolling. */
@media (max-height: 720px) {
    .login--compact .login__hero { min-height: 96px; }
    .login--compact .login__panel { margin-top: 0; padding-top: 12px; }
    .login--compact .login__brand { flex-direction: row; gap: 12px; text-align: left; }
    .login--compact .login__names { align-items: flex-start; }
    .login--compact .login__emblem { width: 52px; height: 52px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .22); }
    .login--compact .login__emblem img { width: 38px; height: 38px; }
    .login--compact .login__church { margin: 0; font-size: 1.08rem; }
    .login--compact .login__place { margin-top: 1px; padding-left: 0; font-size: .86rem; }
    .login--compact .login__card { margin-top: 12px; padding: 14px 14px; gap: 10px; }
}

/* ---------- the white card ---------- */
.login__card {
    width: 100%;
    max-width: 400px;
    margin-top: 12px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 22px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 18px 40px rgba(3, 12, 40, .38);
}

.login--compact .login__card { padding: 18px 16px; gap: 12px; }

.login__step {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    row-gap: 6px;
}

.login__step-count {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #5B6B8C;
}

.login__step-dots {
    display: inline-flex;
    gap: 5px;
}

.login__step-dots span {
    width: 22px;
    height: 4px;
    border-radius: 2px;
    background: #DCE3F0;
}

.login__step-dots span.is-done { background: var(--navy); }

.login__step .login__title { grid-column: 1 / -1; }

.login__title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--ink);
}

.login__label {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .95rem;
    font-weight: 600;
    color: #1E293B;
}

.login__label--center { align-items: center; text-align: center; }

.login__ml {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: #64748B;
}

.login__text {
    margin: 0;
    font-size: .92rem;
    line-height: 1.5;
    color: #475569;
}

.login__text--center { text-align: center; }

.login__hint {
    margin: 0;
    font-size: .8rem;
    color: #64748B;
}

.login__hint--center { text-align: center; }

/* "The code is on WhatsApp, not SMS" - members instinctively look in Messages for an OTP. */
.login__wa-note {
    margin: 0;
    padding: 10px 12px;
    border-left: 4px solid #148A4B;
    border-radius: 10px;
    background: #ECFDF3;
    font-size: .86rem;
    line-height: 1.45;
    color: #14532D;
}

.login__wa-note .login__ml { margin-top: 2px; color: #3F6B50; }

/* ---------- mobile number ---------- */
.login__phone {
    display: flex;
    gap: 8px;
    height: 54px;
}

.login__cc {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0 12px;
    border: 2px solid #CBD5E1;
    border-radius: 12px;
    background: #F8FAFC;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

/* The real <select> sits invisibly on top: the box shows just flag + code,
   while the opened list shows full country names. */
.login__cc select {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    font-size: 16px;
    cursor: pointer;
}

.login__cc:focus-within,
.login__input:focus {
    border-color: var(--gold-ring);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(217, 162, 27, .22);
}

.login__input {
    flex: 1;
    min-width: 0;
    padding: 0 14px;
    border: 2px solid #CBD5E1;
    border-radius: 12px;
    background: #F8FAFC;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--ink);
    outline: none;
}

.login__input::placeholder {
    color: #B6C0D2;
    font-weight: 500;
}

.login__sentto {
    margin: -6px 0 0;
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--ink);
}

/* ---------- buttons ---------- */
.login__btn {
    min-height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 14px;
    background: var(--navy);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(20, 53, 126, .28);
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s, opacity .15s;
}

.login__btn:active:not(:disabled) { transform: scale(.98); }
.login__btn:disabled { opacity: .6; }
.login__btn:hover { color: #fff; }

.login__btn--whatsapp {
    background: #148A4B;
    box-shadow: 0 6px 14px rgba(20, 138, 75, .28);
}

/* Fingerprint: the main way in on the resting unlock screen, so the biggest target there. */
.login__btn--bio {
    min-height: 58px;
    font-size: 1.04rem;
}

.login__btn--ghost {
    background: #fff;
    color: var(--navy);
    border: 2px solid #C9D4EA;
    box-shadow: none;
}

.login__btn--ghost:hover { color: var(--navy); }

.login__links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #94A3B8;
}

.login__link {
    align-self: center;
    min-height: 40px;
    padding: 6px 10px;
    border: none;
    background: none;
    font-size: .92rem;
    font-weight: 700;
    color: var(--navy);
}

.login__link:disabled { opacity: .5; }

.login__link--inline {
    min-height: 0;
    padding: 0 0 0 8px;
    font-size: .86rem;
    text-decoration: underline;
}

.login__or {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    color: #64748B;
}

.login__or::before,
.login__or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}

/* ---------- messages ---------- */
.login__error {
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: #FEF2F2;
    font-size: .86rem;
    font-weight: 600;
    color: #B91C1C;
}

.login__error--center { text-align: center; }

.login__locked {
    padding: 12px 14px;
    border: 1px solid #FECACA;
    border-radius: 12px;
    background: #FEF2F2;
    font-size: .9rem;
    line-height: 1.45;
    color: #991B1B;
}

/* ---------- welcome back / biometric ---------- */
.login__welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login__welcome-hi {
    font-size: .86rem;
    font-weight: 600;
    color: #64748B;
}

.login__welcome-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ink);
}

.login__bio-art {
    align-self: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #EEF2FA;
    color: var(--navy);
    display: grid;
    place-items: center;
}

.login__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 0;
    font-size: .92rem;
    color: #64748B;
}

.login__spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #DCE3F0;
    border-top-color: var(--navy);
    animation: login-spin .8s linear infinite;
}

@keyframes login-spin { to { transform: rotate(360deg); } }

/* ---------- footer notice ---------- */
.login__notice {
    margin: 0;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    font-size: .74rem;
    color: #B4C6EE;
}

.login__message {
    margin: 0 0 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #FFF7E6;
    border: 1px solid #F5D9A0;
    color: #7A4B00;
    font-size: .8rem;
    line-height: 1.4;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .login__emblem { transition: none; }
}

/* Unlock screen: whose phone this is (Android keeps the link through an uninstall). */
.login__device {
    margin: -4px 0 0;
    text-align: center;
    font-size: .8rem;
    line-height: 1.45;
    color: #64748B;
}

.login__device strong { color: var(--ink); }

/* "Not Sneha?" confirmation, and "your registration moved here" after a new-phone sign-in. */
.login__switch {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login__moved {
    margin: 0;
    padding: 10px 12px;
    border-left: 4px solid #14357E;
    border-radius: 10px;
    background: #EEF2FF;
    font-size: .84rem;
    line-height: 1.45;
    color: #1E3A8A;
}
