/* ============================================================
   auth.css - UseToPay authentication screens (login / verify / forgot).
   A standalone look for the public auth pages: split-screen "aurora"
   brand panel + a light, airy form pane with floating-label fields.
   Everything is scoped under .utp-auth so it never leaks into the
   Bootstrap-based portal pages that share the same master.
   ============================================================ */

.utp-auth {
    --navy: #070b26;
    --navy-2: #0d1440;
    --brand: #2f43c9;
    --brand-2: #4f6bff;
    --accent: #00c2a8;
    --ink: #10162e;
    --muted: #6b7590;
    --line: #e4e7f2;
    --soft: #f6f7fb;
    --ok: #0f9d63;
    --err: #d92d20;
    --radius: 16px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #fff;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.utp-auth * { box-sizing: border-box; }

/* ---------------- brand panel (left) ---------------- */
.utp-brand {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, #131a52 100%);
    color: #fff;
    padding: 44px 46px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
/* aurora blobs */
.utp-brand::before, .utp-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: .5;
    pointer-events: none;
}
.utp-brand::before { width: 520px; height: 520px; background: var(--brand-2); top: -150px; left: -130px; animation: utpFloat 18s ease-in-out infinite; }
.utp-brand::after  { width: 460px; height: 460px; background: var(--accent); bottom: -170px; right: -110px; animation: utpFloat 23s ease-in-out infinite reverse; }
@keyframes utpFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(34px, -26px) scale(1.09); }
}
.utp-brand > * { position: relative; z-index: 1; }

.utp-logo { display: flex; align-items: center; gap: 11px; }
/* logo sits on the dark brand panel -> place it on a white chip so any logo colour stays legible */
.utp-logo img {
    max-height: 34px; width: auto; display: block;
    background: #fff; padding: 8px 12px; border-radius: 12px;
    box-shadow: 0 8px 20px -10px rgba(0,0,0,.55);
}
.utp-logo span { font-weight: 700; letter-spacing: .3px; font-size: 16px; color: #fff; }

.utp-hero h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -.4px; }
.utp-hero p { margin: 0 0 26px; font-size: 15px; line-height: 1.65; color: rgba(255,255,255,.72); max-width: 400px; }
.utp-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.utp-feats li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: rgba(255,255,255,.9); }
.utp-feats .tick {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
    background: rgba(0,194,168,.16); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(0,194,168,.34);
}
.utp-brand-foot { font-size: 12px; color: rgba(255,255,255,.5); line-height: 1.6; }
.utp-brand-foot a { color: rgba(255,255,255,.75); text-decoration: none; }

/* ---------------- form pane (right) ---------------- */
.utp-pane { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--soft); }
.utp-card { width: 100%; max-width: 428px; }

.utp-top { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 18px; }
.utp-home {
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
    font-size: 12.5px; font-weight: 700; color: var(--muted);
    border: 1.5px solid var(--line); background: #fff; padding: 7px 13px; border-radius: 999px; transition: all .15s;
}
.utp-home:hover { color: var(--brand); border-color: #c8d0f0; }

.utp-head h2 { margin: 0 0 5px; font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.utp-head p { margin: 0 0 20px; font-size: 13.5px; color: var(--muted); }

/* segmented QR / password switch */
.utp-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #eceffa; border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.utp-seg a, .utp-seg .seg {
    text-align: center; padding: 9px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
    color: var(--muted); text-decoration: none; cursor: pointer; border: none; background: none; transition: all .15s;
}
.utp-seg .on { background: #fff; color: var(--brand); box-shadow: 0 4px 12px -4px rgba(16,22,46,.22); }

/* floating-label field */
.utp-field { position: relative; margin-bottom: 16px; }
.utp-field .utp-in {
    width: 100%; height: 58px; border: 1.5px solid var(--line); border-radius: 14px;
    padding: 23px 14px 7px; font-size: 15px; color: var(--ink); background: #fff; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.utp-field label {
    position: absolute; left: 15px; top: 18px; font-size: 14.5px; color: #97a0b8;
    pointer-events: none; transition: all .14s ease; font-weight: 500;
}
.utp-field .utp-in:hover { border-color: #cdd4e8; }
.utp-field .utp-in:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(79,107,255,.13); }
.utp-field .utp-in:focus + label,
.utp-field .utp-in:not(:placeholder-shown) + label { top: 8px; font-size: 11px; font-weight: 700; color: var(--brand); letter-spacing: .2px; }

/* validators */
.utp-auth .rfv { display: block; color: var(--err) !important; font-size: 11.5px; font-weight: 600; margin-top: 5px; }

/* consent row */
.utp-consent { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 18px; font-size: 12.5px; color: var(--muted); }
.utp-consent input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--brand); }
.utp-consent a { color: var(--brand); font-weight: 600; }

/* buttons */
.utp-btn {
    width: 100%; height: 52px; border: none; border-radius: 14px; cursor: pointer;
    background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff;
    font-size: 14.5px; font-weight: 700; letter-spacing: .2px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 12px 26px -12px rgba(47,67,201,.9); transition: transform .12s, box-shadow .15s, opacity .15s;
}
.utp-btn:hover:enabled { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(47,67,201,1); }
.utp-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.utp-btn-ghost {
    background: #fff; color: var(--brand); border: 1.5px solid #c8d0f0; box-shadow: none;
}
.utp-btn-ghost:hover:enabled { background: #eef1ff; border-color: var(--brand-2); transform: none; box-shadow: none; }

/* links row */
.utp-links { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-size: 12.5px; }
.utp-links a { color: var(--brand); font-weight: 700; text-decoration: none; }
.utp-links a:hover { text-decoration: underline; }

/* location chip */
.utp-chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
    padding: 5px 11px; border-radius: 999px; margin-bottom: 16px;
}
.utp-chip.ok { background: #e6f8f1; color: var(--ok); border: 1px solid #bfe9d8; }
.utp-chip.wait { background: #fff4e5; color: #b45309; border: 1px solid #f6dfba; }

/* PIN boxes */
.utp-pin { display: flex; gap: 9px; justify-content: space-between; margin-bottom: 20px; }
.utp-auth .pin {
    width: 100%; height: 58px; text-align: center; font-size: 22px; font-weight: 700;
    border: 1.5px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.utp-auth .pin:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(79,107,255,.13); }

/* QR block */
.utp-qr { border: 1.5px dashed #cfd6ee; border-radius: var(--radius); background: #fff; padding: 18px; text-align: center; margin-bottom: 18px; }
.utp-qr img { width: 190px; height: auto; max-width: 100%; }
.utp-qr-steps { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; display: grid; gap: 9px; }
.utp-qr-steps li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.utp-qr-steps .n {
    flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: #eef1ff; color: var(--brand);
    font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}

/* alerts (Common.Function.showMessage emits Bootstrap alert markup) */
.utp-auth .alert { border-radius: 12px; font-size: 13px; padding: 11px 14px; border: 1px solid transparent; }
.utp-auth .alert-danger { background: #fdecec; color: #b42121; border-color: #f4cccc; }
.utp-auth .alert-success { background: #e9f8ef; color: #0f7a45; border-color: #cbead8; }

/* ---------------- location gate ---------------- */
.utp-loc {
    position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(7,11,38,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.utp-loc-box {
    background: #fff; border-radius: 20px; padding: 32px 30px; text-align: center; max-width: 380px;
    box-shadow: 0 30px 70px -20px rgba(7,11,38,.6); animation: utpPop .22s ease;
}
@keyframes utpPop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.utp-loc-ic {
    width: 62px; height: 62px; border-radius: 50%; background: #eef1ff; color: var(--brand);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; position: relative;
}
.utp-loc-ic::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid rgba(79,107,255,.25); border-top-color: var(--brand-2); animation: utpSpin 1.1s linear infinite;
}
.utp-loc-box.done .utp-loc-ic::after, .utp-loc-box.fail .utp-loc-ic::after { animation: none; border-color: transparent; }
.utp-loc-box.fail .utp-loc-ic { background: #fdecec; color: var(--err); }
@keyframes utpSpin { to { transform: rotate(360deg); } }
.utp-loc-box h4 { margin: 0 0 7px; font-size: 17px; font-weight: 800; color: var(--ink); }
.utp-loc-box p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.utp-loc-box .utp-btn { margin-top: 18px; height: 46px; }

/* ============================================================
   UseToPay loader (unique, CSS-only). Brand-gradient ring +
   orbiting accent dot + pulsing rupee mark + shimmering wordmark.
   Uses literal brand colours so it also works outside the
   .utp-auth scope (e.g. inside the UpdateProgress templates).
   ============================================================ */
.utp-loader { position: relative; width: 66px; height: 66px; flex: 0 0 auto; }
.utp-loader-ring {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 90deg, #070b26, #2f43c9, #4f6bff, #00c2a8, #070b26);
    -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 7px), #000 calc(100% - 6px));
            mask: radial-gradient(farthest-side, #0000 calc(100% - 7px), #000 calc(100% - 6px));
    animation: utpRing 1.15s linear infinite;
}
.utp-loader-ring::after {
    content: ""; position: absolute; top: -2px; left: 50%; margin-left: -5px;
    width: 10px; height: 10px; border-radius: 50%; background: #00c2a8;
    box-shadow: 0 0 12px 2px rgba(0,194,168,.7);
}
.utp-loader-mark {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 800; font-size: 27px; color: #2f43c9; animation: utpMark 1.15s ease-in-out infinite;
}
@keyframes utpRing { to { transform: rotate(360deg); } }
@keyframes utpMark { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.14); opacity: 1; } }

.utp-loader-brand {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 800; font-size: 15px; letter-spacing: .4px;
    background: linear-gradient(90deg, #10162e 18%, #4f6bff 50%, #10162e 82%);
    background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: utpShimmer 1.5s linear infinite;
}
@keyframes utpShimmer { to { background-position: -220% 0; } }

/* QR poll overlay reuses the loader */
#loaderOverlay {
    position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
    background: rgba(255,255,255,.8); z-index: 5; border-radius: 16px;
}

/* progress overlay (UpdateProgress) */
.modalprog { position: fixed; inset: 0; z-index: 99999; background: rgba(7,11,38,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.centerprog {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #fff; border-radius: 18px; padding: 26px 32px; box-shadow: 0 24px 60px -18px rgba(7,11,38,.6);
    display: flex; flex-direction: column; align-items: center; gap: 15px;
}

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
    .utp-auth { grid-template-columns: 1fr; }
    .utp-brand { padding: 26px 22px; }
    .utp-hero, .utp-brand-foot { display: none; }
    .utp-pane { padding: 28px 18px 40px; align-items: flex-start; }
}
@media (max-width: 420px) {
    .utp-pin { gap: 6px; }
    .utp-auth .pin { height: 52px; font-size: 19px; }
    .utp-head h2 { font-size: 21px; }
}
