/* ============================================================
   CIVIL ENGINEERS FORUM — sign in, forgot & reset password
   One card: the forum photo and what members get on the left,
   the form on the right. On tablets and phones the photo becomes
   a short banner above the form. Tokens come from style.css.
   ============================================================ */

.cx-auth {
    position: relative; isolation: isolate; overflow: hidden;
    padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 88px);
    background: #eef3fb;
}
.cx-auth__bg {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(40% 45% at 4% 6%, rgba(37, 99, 235, 0.16), transparent 70%),
        radial-gradient(34% 40% at 98% 10%, rgba(251, 191, 36, 0.2), transparent 70%),
        radial-gradient(44% 50% at 82% 100%, rgba(20, 184, 166, 0.15), transparent 70%),
        linear-gradient(180deg, #f5f8fd 0%, #e8eff9 100%);
}
.cx-auth__bg::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.07) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, #000 30%, transparent 86%);
    mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, #000 30%, transparent 86%);
}

.cx-auth__shell {
    display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    max-width: 1120px; min-height: 620px; margin: 0 auto;
    border-radius: 30px; overflow: hidden; background: #fff;
    box-shadow: 0 44px 90px -42px rgba(11, 31, 75, 0.5), 0 0 0 1px rgba(15, 23, 42, 0.06);
    animation: cxRise 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes cxRise { from { transform: translateY(14px); } to { transform: none; } }

/* ---------- the photo side ---------- */
.cx-auth__visual { position: relative; isolation: isolate; display: flex; color: #fff; background: #0b1f4b; min-width: 0; }
.cx-auth__photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.cx-auth__visual::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(70% 45% at 100% 0%, rgba(251, 191, 36, 0.22), transparent 70%),
        linear-gradient(168deg, rgba(8, 22, 64, 0.5) 0%, rgba(11, 31, 75, 0.76) 40%, rgba(7, 18, 52, 0.96) 100%);
}
.cx-auth__visual::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 36px 36px;
}
.cx-auth__visual-inner { display: flex; flex-direction: column; gap: 26px; width: 100%; padding: 38px 40px 34px; }

.cx-auth__brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; align-self: flex-start; }
.cx-auth__brand:hover { color: #fff; }
.cx-auth__badge { flex: none; width: 52px; height: 52px; padding: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); }
.cx-auth__badge img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }
.cx-auth__brand strong { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.cx-auth__brand small { display: block; margin-top: 3px; font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-soft); }

.cx-auth__pitch { margin-top: auto; }
.cx-auth__eyebrow {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill, 999px);
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
}
.cx-auth__eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22); }
.cx-auth__headline { margin: 16px 0 12px; font-family: var(--font-display); font-size: clamp(26px, 2.3vw, 34px); font-weight: 800; line-height: 1.14; letter-spacing: -0.03em; color: #fff; }
.cx-auth__headline em { font-style: normal; background: var(--grad-text-dark); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cx-auth__text { max-width: 44ch; margin: 0; font-size: 15px; line-height: 1.7; color: rgba(255, 255, 255, 0.78); }

.cx-auth__perks { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.cx-auth__perks li {
    display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 16px;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cx-auth__perks i { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; color: var(--navy); background: var(--grad-gold); }
.cx-auth__perks strong { display: block; font-size: 14px; font-weight: 700; color: #fff; }
.cx-auth__perks small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.66); }

.cx-steps { display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: cxstep; }
.cx-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.55; color: rgba(255, 255, 255, 0.86); }
.cx-steps li::before {
    counter-increment: cxstep; content: counter(cxstep);
    flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-size: 13px; font-weight: 800; color: var(--navy); background: var(--grad-gold);
}

.cx-auth__fest {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: 18px;
    color: #fff; text-decoration: none;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(37, 99, 235, 0.16));
    border: 1px solid rgba(251, 191, 36, 0.35);
    transition: transform var(--dur, 200ms) ease, border-color var(--dur, 200ms) ease;
}
.cx-auth__fest:hover { color: #fff; transform: translateY(-2px); border-color: rgba(251, 191, 36, 0.7); }
.cx-auth__fest img { flex: none; width: 48px; height: 48px; padding: 2px; border-radius: 50%; background: #fff; object-fit: contain; }
.cx-auth__fest strong { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 800; }
.cx-auth__fest small { display: block; margin-top: 2px; font-size: 12.5px; color: rgba(255, 255, 255, 0.74); }
.cx-auth__fest > i { margin-left: auto; color: var(--gold-soft); }

/* ---------- the form side ---------- */
.cx-auth__panel { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 48px 52px; background: #fff; }
.cx-auth__form { width: 100%; max-width: 400px; }
.cx-auth__kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.cx-auth__kicker i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; color: var(--blue); background: var(--blue-100); }
.cx-auth__title { margin: 12px 0 8px; font-family: var(--font-display); font-size: clamp(28px, 2.5vw, 34px); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--ink); }
.cx-auth__lede { margin: 0 0 26px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.cx-auth__lede a { color: var(--blue); font-weight: 700; }

.cx-auth .alert { margin: 0 0 18px; border-radius: 14px; }

.cx-field { margin-bottom: 18px; }
.cx-field__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cx-field__label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.cx-field__top a { font-size: 13px; font-weight: 700; color: var(--blue); text-decoration: none; }
.cx-field__top a:hover { text-decoration: underline; }

.cx-input { position: relative; display: flex; align-items: center; }
.cx-input > i { position: absolute; left: 16px; font-size: 16px; color: #94a3b8; pointer-events: none; transition: color var(--dur, 200ms) ease; }
.cx-input input {
    width: 100%; height: 54px; margin: 0; padding: 0 16px 0 46px;
    border: 1.5px solid #dbe3ef; border-radius: 14px; background: #f8fafd;
    font-family: var(--font-body); font-size: 16px; font-weight: 500; color: var(--ink);
    -webkit-appearance: none; appearance: none;
    transition: border-color var(--dur, 200ms) ease, box-shadow var(--dur, 200ms) ease, background-color var(--dur, 200ms) ease;
}
.cx-input input::placeholder { color: #94a3b8; font-weight: 400; }
.cx-input input:hover { border-color: #c4d0e2; }
.cx-input input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14); }
.cx-input:focus-within > i { color: var(--blue); }
.cx-input input[readonly] { color: var(--muted); background: #f1f5f9; }
.cx-input input.is-invalid, .cx-input input[aria-invalid="true"] { border-color: #f87171; background: #fff7f7; }
.cx-input--toggle input { padding-right: 54px; }
.cx-input__toggle {
    position: absolute; right: 6px; width: 42px; height: 42px; border: 0; border-radius: 10px;
    display: grid; place-items: center; background: transparent; color: #64748b; cursor: pointer;
    transition: background-color var(--dur, 200ms) ease, color var(--dur, 200ms) ease;
}
.cx-input__toggle:hover, .cx-input__toggle:focus-visible { background: #eef2f7; color: var(--ink); outline: none; }
.cx-hint { display: flex; align-items: center; gap: 6px; margin: 7px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted-light); }
.cx-hint i { font-size: 12px; color: var(--blue); }

.cx-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 2px 0 22px; }
.cx-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.cx-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.cx-secure { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted-light); }
.cx-secure i { color: var(--green-500); }

.cx-btn {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 54px; padding: 0 20px; border: 0; border-radius: 14px;
    font-family: var(--font-display); font-size: 15.5px; font-weight: 700; line-height: 1;
    text-decoration: none; cursor: pointer;
    transition: transform var(--dur, 200ms) ease, box-shadow var(--dur, 200ms) ease, border-color var(--dur, 200ms) ease, color var(--dur, 200ms) ease;
}
.cx-btn--primary { color: #fff; background: linear-gradient(135deg, #2563eb 0%, #1e40af 62%, #172e7a 100%); box-shadow: 0 18px 34px -16px rgba(37, 99, 235, 0.85); }
.cx-btn--primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 22px 40px -16px rgba(37, 99, 235, 0.95); }
.cx-btn--primary i { transition: transform var(--dur, 200ms) ease; }
.cx-btn--primary:hover i { transform: translateX(3px); }
.cx-btn--ghost { color: var(--navy); background: #fff; border: 1.5px solid #dbe3ef; }
.cx-btn--ghost:hover { color: var(--blue); border-color: var(--blue); }
.cx-btn:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.cx-btn.is-busy { pointer-events: none; color: transparent; }
.cx-btn.is-busy i { opacity: 0; }
.cx-btn.is-busy::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
    border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%;
    animation: cxSpin 700ms linear infinite;
}
@keyframes cxSpin { to { transform: rotate(360deg); } }

.cx-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0 16px; font-size: 12.5px; font-weight: 600; color: var(--muted-light); }
.cx-divider::before, .cx-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

.cx-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin: 22px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.cx-help i { color: var(--green-500); }
.cx-help a { color: var(--ink); font-weight: 700; text-decoration: none; }
.cx-help a:hover { color: var(--blue); }

/* ---------- tablets ---------- */
@media (max-width: 991px) {
    .cx-auth__shell { grid-template-columns: minmax(0, 1fr); max-width: 580px; min-height: 0; border-radius: 26px; }
    .cx-auth__visual-inner { gap: 18px; padding: 26px 26px 28px; }
    .cx-auth__pitch { margin-top: 4px; }
    .cx-auth__headline { margin: 12px 0 8px; font-size: 25px; }
    .cx-auth__text { font-size: 14px; }
    .cx-auth__perks, .cx-steps, .cx-auth__fest { display: none; }
    .cx-auth__panel { padding: 32px 28px 36px; }
    .cx-auth__form { max-width: none; }
}

/* ---------- phones ---------- */
@media (max-width: 575px) {
    .cx-auth { padding: 14px 0 34px; }
    .cx-auth__shell { border-radius: 22px; }
    .cx-auth__visual-inner { gap: 14px; padding: 20px 18px 22px; }
    .cx-auth__badge { width: 44px; height: 44px; }
    .cx-auth__brand strong { font-size: 16px; }
    .cx-auth__brand small { font-size: 9px; letter-spacing: 0.16em; }
    .cx-auth__eyebrow { font-size: 10px; padding: 5px 10px; }
    .cx-auth__headline { margin: 10px 0 0; font-size: 21px; }
    .cx-auth__text { display: none; }
    .cx-auth__panel { padding: 24px 18px 28px; }
    .cx-auth__title { margin-top: 10px; font-size: 26px; }
    .cx-auth__lede { margin-bottom: 20px; font-size: 14.5px; }
    .cx-input input, .cx-btn { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    .cx-auth__shell { animation: none; }
    .cx-btn, .cx-btn i, .cx-auth__fest { transition: none; }
}
