/* =========================================================================
   ProcureX — Login screen (light + compact)
   Two-column split: subtle brand showcase + clean form card.
   ========================================================================= */

:root {
    --bg:            #f7f8fc;
    --surface:       #ffffff;
    --surface-2:     #f1f5f9;
    --border:        #e5e7eb;
    --border-strong: #cbd5e1;

    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;

    --primary:      #4f46e5;
    --primary-600:  #4338ca;
    --primary-soft: #eef2ff;
    --primary-ring: rgba(79, 70, 229, .15);
    --accent:       #06b6d4;
    --pink:         #ec4899;
    --emerald:      #10b981;
    --danger:       #ef4444;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow:    0 2px 6px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 14px 32px -12px rgba(15, 23, 42, .12);
    --shadow-lg: 0 24px 56px -16px rgba(15, 23, 42, .16);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.auth-shell {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink-900);
    background: var(--bg);
    overflow: hidden;
    min-height: 100vh;
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Subtle background ---------- */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 80% -10%, rgba(79, 70, 229, .10), transparent 60%),
        radial-gradient(ellipse 60% 50% at 10% 110%, rgba(6, 182, 212, .08), transparent 60%),
        var(--bg);
}
.auth-bg .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: .35;
    will-change: transform;
}
.auth-bg .blob-1 {
    width: 400px; height: 400px;
    top: -120px; left: -60px;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    animation: floatA 22s ease-in-out infinite;
}
.auth-bg .blob-2 {
    width: 380px; height: 380px;
    bottom: -140px; right: -80px;
    background: linear-gradient(135deg, #67e8f9, #93c5fd);
    animation: floatB 28s ease-in-out infinite;
}
.auth-bg .blob-3 {
    width: 320px; height: 320px;
    top: 45%; left: 40%;
    background: linear-gradient(135deg, #fbcfe8, #fda4af);
    opacity: .22;
    animation: floatC 32s ease-in-out infinite;
}
@keyframes floatA {
    0%,100% { transform: translate(0, 0) scale(1); }
    50%     { transform: translate(60px, 40px) scale(1.08); }
}
@keyframes floatB {
    0%,100% { transform: translate(0, 0) scale(1); }
    50%     { transform: translate(-70px, -40px) scale(1.12); }
}
@keyframes floatC {
    0%,100% { transform: translate(0, 0) scale(1); }
    50%     { transform: translate(50px, -60px) scale(.95); }
}
.auth-bg .grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 100%);
}
.auth-bg .noise { display: none; } /* not needed in light mode */

/* ---------- Layout ---------- */
.auth-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: stretch;
}
@media (max-width: 960px) {
    .auth-stage { grid-template-columns: 1fr; }
    .brand-panel { display: none !important; }
}

/* ---------- Brand showcase (left) ---------- */
.brand-panel {
    position: relative;
    padding: 40px 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--ink-900);
    overflow: hidden;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeUp .6s ease both;
}
/* Original ProcureX wordmark (1013x333) at a readable size on the brand panel */
.brand-logo-img {
    height: 46px;
    width: auto;
    display: block;
}
@media (max-width: 480px) { .brand-logo-img { height: 40px; } }
.brand-logo span[style] { font-weight: 700; }
.brand-logo .ring {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--primary), var(--accent), var(--pink), var(--primary));
    padding: 2px;
    display: grid;
    place-items: center;
    animation: spin 14s linear infinite;
}
.brand-logo .ring i {
    width: 100%; height: 100%;
    background: var(--surface);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-style: normal;
}
.brand-logo .ring i img { height: 18px; opacity: 1; filter: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand-hero { margin-top: -16px; animation: fadeUp .7s .1s ease both; }
.brand-eyebrow {
    text-transform: uppercase;
    letter-spacing: .2em;
    font-size: 10.5px;
    color: var(--ink-500);
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.brand-eyebrow .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
    animation: pulse 2s ease infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%     { opacity: .55; transform: scale(.85); }
}

.brand-headline {
    font-size: clamp(28px, 3.8vw, 44px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 16px;
    color: var(--ink-900);
}
.brand-headline .grad {
    background: linear-gradient(120deg, #4f46e5 0%, #06b6d4 50%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-sub {
    color: var(--ink-500);
    font-size: 13.5px;
    max-width: 420px;
    line-height: 1.6;
    margin: 0 0 24px;
}

.brand-features {
    display: grid;
    gap: 10px;
    max-width: 420px;
    animation: fadeUp .8s .25s ease both;
}
.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.brand-feature:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.brand-feature .ico {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: grid; place-items: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.brand-feature .ico-1 { background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.brand-feature .ico-2 { background: linear-gradient(135deg, var(--accent), #3b82f6); }
.brand-feature .ico-3 { background: linear-gradient(135deg, var(--pink), #f97316); }
.brand-feature .body strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink-900); }
.brand-feature .body span  { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }

.brand-footer {
    font-size: 11px;
    color: var(--ink-400);
    letter-spacing: .04em;
    animation: fadeUp .8s .4s ease both;
}
.brand-footer strong { color: var(--ink-700); font-weight: 600; }

/* ---------- Form card (right) ---------- */
.form-panel {
    position: relative;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;        /* centers .form-card horizontally */
}
@media (max-width: 960px) {
    .form-panel { padding: 24px 16px; min-height: 100vh; }
}

.form-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 24px 22px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: cardIn .55s cubic-bezier(.16,1,.3,1) both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-card h2 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0 0 4px;
    color: var(--ink-900);
}
.form-card .form-sub {
    color: var(--ink-500);
    font-size: 12px;
    margin: 0 0 18px;
}

/* ---------- Step transitions ---------- */
.form-step { animation: stepIn .35s ease both; }
@keyframes stepIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Floating label inputs ---------- */
.field {
    position: relative;
    margin-bottom: 10px;
}
.field input {
    width: 100%;
    padding: 16px 12px 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--ink-900);
    font-size: 13.5px;
    line-height: 1.2;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.field input::placeholder { color: transparent; }
.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type="number"] { -moz-appearance: textfield; }

.field label {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--ink-500);
    font-size: 12.5px;
    pointer-events: none;
    transition: all .15s ease;
    padding: 0 4px;
    background: var(--surface);
}
.field input:focus,
.field input:not(:placeholder-shown) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
    top: -6px;
    font-size: 10px;
    color: var(--primary);
    letter-spacing: .02em;
    font-weight: 600;
}
.field .field-icon {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-400);
    pointer-events: none;
    font-size: 12px;
}

/* OTP field */
.field.otp input {
    text-align: center;
    letter-spacing: .5em;
    font-size: 17px;
    font-weight: 600;
    padding-left: 12px;
}
.field.otp input:focus + label,
.field.otp input:not(:placeholder-shown) + label {
    letter-spacing: .02em;
}

/* ---------- Buttons ---------- */
.btn-cta {
    position: relative;
    width: 100%;
    padding: 9px 14px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .02em;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .18s ease, background-position .45s ease;
    box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .45);
}
.btn-cta:hover {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -10px rgba(6, 182, 212, .55);
}
.btn-cta:active { transform: translateY(0); }
.btn-cta::after {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 55%; height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.40) 50%, transparent 100%);
    transform: skewX(-20deg);
    transition: left .6s ease;
}
.btn-cta:hover::after { left: 130%; }

.alt-action {
    position: relative;
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-500);
}
.alt-action::before,
.alt-action::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 32%;
    height: 1px;
    background: var(--border);
}
.alt-action::before { left: 0; }
.alt-action::after  { right: 0; }
.alt-action a, .alt-action .link {
    color: var(--primary);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    padding: 0 8px;
    font-size: 12px;
}
.alt-action a:hover, .alt-action .link:hover { color: var(--primary-600); }

.back-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--ink-500);
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover { color: var(--ink-900); }

.field-alert {
    display: block;
    color: var(--danger);
    font-size: 11.5px;
    margin: -6px 0 10px;
    min-height: 14px;
}
.field-alert:not(:empty) {
    animation: shake .3s ease;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-3px); }
    75%     { transform: translateX(3px); }
}

.otp-meta {
    text-align: center;
    font-size: 11.5px;
    color: var(--ink-500);
    margin: -4px 0 12px;
}
.otp-meta .countdown { color: var(--primary); font-weight: 700; letter-spacing: .06em; margin-left: 4px; }
.otp-meta .resend    { color: var(--emerald); font-weight: 600; cursor: pointer; }
.otp-channel { color: var(--ink-900); font-weight: 600; }

.form-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 10.5px;
    color: var(--ink-400);
    letter-spacing: .04em;
}
.form-footer strong { color: var(--ink-700); font-weight: 600; }

/* ---------- Loader ---------- */
.px-loader {
    position: fixed; inset: 0;
    display: none;
    z-index: 9999;
}
.px-loader.show { display: block; }
.px-loader__bg {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, .25);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.px-loader__spinner {
    position: absolute; left: 50%; top: 50%;
    width: 44px; height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.5);
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    animation: spinLoader .85s linear infinite;
}
@keyframes spinLoader { to { transform: rotate(360deg); } }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-bg .blob, .brand-logo .ring, .brand-eyebrow .dot { animation: none !important; }
    .form-card, .form-step, .brand-hero, .brand-features, .brand-footer, .brand-logo { animation: none !important; }
}

/* =========================================================================
   v2 POLISH LAYER — richer depth + focus + mobile tap targets
   ========================================================================= */
.form-card {
    box-shadow: 0 30px 80px -40px rgba(15, 23, 42, .55), 0 2px 10px rgba(15, 23, 42, .06);
    border: 1px solid rgba(255, 255, 255, .65);
    backdrop-filter: blur(6px);
}
.field input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .15);
}
.field-icon { transition: color .15s; }
.field input:focus ~ .field-icon { color: #4f46e5; }
.btn-cta {
    background-image: linear-gradient(135deg, #4f46e5 0%, #6d28d9 55%, #7c3aed 100%);
    box-shadow: 0 12px 26px -12px rgba(79, 70, 229, .7);
    letter-spacing: .01em;
}
.btn-cta:hover { box-shadow: 0 16px 34px -12px rgba(79, 70, 229, .82); }
.field-alert:not(:empty) {
    display: block; margin: 2px 0 10px; padding: 7px 11px;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 9px;
    color: #b91c1c; font-size: 12px; font-weight: 600;
}
@media (max-width: 480px) {
    .form-card { padding: 22px 18px; border-radius: 16px; }
    .btn-cta { padding: 13px; font-size: 15px; }   /* larger tap target on phones */
    .field input { font-size: 16px; }              /* prevents iOS zoom-on-focus */
}
