/* =========================================================================
   DEM MONEY — borrower registration (/borrower/register) and Google country step.
   Approved design 2026-10-31. Scoped to body.dm-reg so the legacy auth styles
   (mystyle.css, borrower.css, material-dashboard.css) do not leak in or out.
   ========================================================================= */

@font-face {
    font-family: 'InterVariable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../vendor/inter/inter-latin-wght-normal.woff2') format('woff2-variations');
}

body.dm-reg {
    --reg-navy: #081D36;
    --reg-blue: #078FF4;
    --reg-blue-dark: #0069D9;
    --reg-text: #10254A;
    --reg-muted: #5B6B82;
    --reg-border: #D6E1EE;
    --reg-danger: #C4202F;
    margin: 0;
    background: #F5F8FC;
    color: var(--reg-text);
    font-family: 'InterVariable', 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.dm-reg *, .dm-reg *::before, .dm-reg *::after { box-sizing: border-box; }

.dm-reg__layout { display: grid; grid-template-columns: minmax(0, 48fr) minmax(0, 52fr); align-items: start; min-height: 100vh; }

/* ---- form side ---- */
.dm-reg__main {
    position: relative; overflow: hidden; display: flex; justify-content: center; align-items: flex-start;
    padding: 30px 32px 36px; background: linear-gradient(180deg, #F8FAFD 0%, #F2F6FB 100%);
}
.dm-reg__main::before { /* soft decorative arc, bottom left */
    content: ''; position: absolute; left: -220px; bottom: -220px; width: 460px; height: 460px; border-radius: 50%;
    border: 70px solid rgba(7, 143, 244, .06); pointer-events: none;
}
.dm-reg__stage { position: relative; width: 100%; max-width: 540px; }
.dm-reg__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--reg-navy) !important; text-decoration: none !important; font-weight: 800; font-size: 26px; letter-spacing: -.01em; }
.dm-reg__brand img { width: 48px; height: 48px; }
.dm-reg__title { margin: 22px 0 8px; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--reg-navy); }
.dm-reg__subtitle { margin: 0 0 22px; max-width: 30em; font-size: 16px; line-height: 1.5; color: var(--reg-muted); }

.dm-reg__card { background: #fff; border: 1px solid #E6EDF5; border-radius: 18px; padding: 20px 22px 16px; box-shadow: 0 18px 48px rgba(8, 29, 54, .07); }
.dm-reg__form { display: grid; gap: 12px; }
.dm-reg__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }

.dm-reg__field { display: grid; gap: 6px; min-width: 0; }
.dm-reg__label { margin: 0; font-size: 14px; font-weight: 600; color: var(--reg-text); }
.dm-reg__control { position: relative; display: flex; align-items: center; }
/* mystyle.css styles every input with input:not(...)x4 (specificity 0,4,1); match that shape inside .dm-reg to win */
.dm-reg .dm-reg__control input.dm-reg__input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
.dm-reg .dm-reg__control select.dm-reg__input:not([multiple]):not([size]):not([hidden]):not([disabled]),
.dm-reg .dm-reg__input {
    width: 100%; height: 46px; margin: 0; padding: 0 44px 0 42px; border: 1px solid var(--reg-border); border-radius: 10px;
    min-height: 46px; background: #fff; color: var(--reg-text); font: inherit; font-size: 15px; font-weight: 400; line-height: 1.4; box-shadow: none; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease; -webkit-appearance: none; appearance: none;
}
.dm-reg .dm-reg__input::placeholder { color: #8A97A8; opacity: 1; }
.dm-reg .dm-reg__control .dm-reg__input:focus { border-color: var(--reg-blue); box-shadow: 0 0 0 3px rgba(7, 143, 244, .15); }
.dm-reg select.dm-reg__input { cursor: pointer; padding-right: 40px; }
.dm-reg .dm-reg__control select.dm-reg__input:not([multiple]):not([size]):not([hidden]):not([disabled]):invalid { color: #8A97A8; } /* placeholder option */
.dm-reg select.dm-reg__input option { color: var(--reg-text); }
.dm-reg__icon { position: absolute; left: 13px; font-size: 20px !important; color: #6B7A90; pointer-events: none; }
.dm-reg__chevron { position: absolute; right: 12px; font-size: 22px !important; color: var(--reg-text); pointer-events: none; }
.dm-reg__toggle {
    position: absolute; right: 6px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: #6B7A90; cursor: pointer;
}
.dm-reg__toggle:hover { color: var(--reg-text); background: #F1F5FA; }
.dm-reg__hint { font-size: 12.5px; color: var(--reg-muted); min-height: 0; }
.dm-reg__hint:empty { display: none; }
.dm-reg__hint strong { color: var(--reg-text); }
.dm-reg__error { font-size: 12.5px; font-weight: 600; color: var(--reg-danger); }
.dm-reg__error:empty { display: none; }
.dm-reg .dm-reg__field.is-invalid .dm-reg__control .dm-reg__input { border-color: #E35B67; box-shadow: 0 0 0 3px rgba(244, 63, 79, .1); }

.dm-reg .dem-auth-error { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #FDECEE; color: var(--reg-danger); font-size: 14px; font-weight: 600; }

/* ---- buttons ---- */
.dm-reg__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin: 0;
    border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
    text-decoration: none !important; text-transform: none; letter-spacing: 0; transition: background .15s ease, border-color .15s ease;
}
.dm-reg__btn .material-icons { font-size: 20px; }
.dm-reg__btn--primary { margin-top: 6px; background: var(--reg-blue); color: #fff !important; box-shadow: 0 8px 20px rgba(7, 143, 244, .25); }
.dm-reg__btn--primary:hover { background: var(--reg-blue-dark); }
.dm-reg__btn--primary[disabled] { opacity: .7; cursor: progress; }
.dm-reg__btn--google { background: #fff; border-color: var(--reg-border); color: var(--reg-blue-dark) !important; }
.dm-reg__btn--google:hover { border-color: var(--reg-blue); background: #F7FBFF; }
.dm-reg__btn:focus-visible, .dm-reg__toggle:focus-visible, .dm-reg a:focus-visible { outline: 3px solid rgba(7, 143, 244, .45); outline-offset: 2px; }

.dm-reg__divider { position: relative; margin: 18px 0 14px; text-align: center; font-size: 13px; color: var(--reg-muted); }
.dm-reg__divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #E6EDF5; }
.dm-reg__divider span { position: relative; padding: 0 12px; background: #fff; }
.dm-reg__footer { margin: 18px 0 6px; text-align: center; font-size: 14px; color: var(--reg-muted); }
.dm-reg__footer a { color: var(--reg-blue-dark); font-weight: 700; }
.dm-reg__slogan { margin: 0; text-align: center; font-size: 12.5px; color: var(--reg-muted); }

.dm-reg__identity { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px; border-radius: 12px; background: #F3F8FE; }
.dm-reg__identity-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--reg-blue); color: #fff; }
.dm-reg__identity strong { display: block; font-size: 15px; color: var(--reg-text); }
.dm-reg__identity span span, .dm-reg__identity > span:last-child { font-size: 13.5px; color: var(--reg-muted); overflow-wrap: anywhere; }

/* ---- photo side ---- */
/* the panel stays one screen tall (sticky) so the photo is not enlarged by a long form */
.dm-reg__visual { position: sticky; top: 0; height: 100vh; min-height: 640px; overflow: hidden; display: flex; align-items: center; background: var(--reg-navy); color: #fff; }
.dm-reg__photo { position: absolute; inset: 0; }
/* photo sized by height and shifted right so the subject sits beside the text (ring bleeds off the edge) */
.dm-reg__photo img { position: absolute; top: 0; left: 12%; height: 100%; width: auto; max-width: none; display: block; }
.dm-reg__visual::before { /* navy fade so the text stays readable over the photo */
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, #081D36 0%, #081D36 18%, rgba(8, 29, 54, .9) 32%, rgba(8, 29, 54, .35) 48%, rgba(8, 29, 54, 0) 62%);
}
.dm-reg__visual-content { position: relative; z-index: 2; max-width: 360px; margin-left: clamp(32px, 6vw, 64px); padding: 48px 0; }
.dm-reg__visual-content h2 { margin: 0 0 18px; font-size: clamp(30px, 2.6vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.dm-reg__visual-content p { margin: 0 0 34px; font-size: 16px; line-height: 1.55; color: #D3DEEC; }
.dm-reg__features { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.dm-reg__features li { display: flex; align-items: center; gap: 16px; }
.dm-reg__features strong { display: block; margin-bottom: 3px; font-size: 16.5px; color: #fff; }
.dm-reg__features li > span:last-child { font-size: 14px; line-height: 1.45; color: #C9D6E6; }
.dm-reg__feature-icon { width: 60px; height: 60px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #fff; }
.dm-reg__feature-icon .material-icons { font-size: 30px; }
.dm-reg__feature-icon--blue { background: #1D5CF2; }
.dm-reg__feature-icon--green { background: #2FAE4E; }
.dm-reg__feature-icon--purple { background: #7B4DF0; }

/* ---- responsive ---- */
@media (min-width: 992px) {
    .dm-reg .dm-reg__control .dm-reg__input, .dm-reg__btn { min-height: 42px; height: 42px; } /* desktop: fits one screen like the approved design */
    .dm-reg__divider { margin: 14px 0 12px; }
    .dm-reg__footer { margin-top: 14px; }
}
@media (max-width: 1199px) {
    .dm-reg__layout { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
    .dm-reg__row { grid-template-columns: minmax(0, 1fr); gap: 12px; } /* narrow form column: no truncated country */
    .dm-reg__photo img { left: 45%; }
    .dm-reg__visual::before { background: linear-gradient(90deg, #081D36 0%, #081D36 45%, rgba(8, 29, 54, .6) 62%, rgba(8, 29, 54, 0) 80%); }
    .dm-reg__visual-content { max-width: 300px; margin-left: 32px; }
}
@media (max-width: 991px) {
    .dm-reg__layout { grid-template-columns: minmax(0, 1fr); }
    .dm-reg__visual { display: none; }
    .dm-reg__main { padding: 28px 20px 40px; }
    .dm-reg__stage { max-width: 560px; }
}
@media (max-width: 575px) {
    .dm-reg__row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .dm-reg__brand { font-size: 22px; }
    .dm-reg__brand img { width: 40px; height: 40px; }
    .dm-reg__title { margin-top: 20px; }
    .dm-reg__subtitle { font-size: 15px; margin-bottom: 20px; }
    .dm-reg__card { padding: 18px 16px 14px; border-radius: 16px; }
    .dm-reg .dm-reg__input { font-size: 16px; } /* no zoom on iOS focus */
}
@media (prefers-reduced-motion: reduce) {
    .dm-reg * { transition: none !important; }
}
