/* ═══════════════════════════════════════════════════════════════════════════
   ivs-auth-v5: the house voice for forms and the sign-in card
   ─────────────────────────────────────────────────────────────────────────
   Born in the affiliate program (hence the ivs-aff / ivs-afa prefixes) and
   extracted the day the agent portal became its second user (rule of two,
   rule-wajib/arsitektur-komponen.md). Owner of every class below; pages
   only size or scope them.

   Users: affiliate/login, forgot, set-password; agent/login-new,
   forgot_password-new, set-password (layout app-blank, no site header);
   affiliate/landing + dashboard + profile (form voice, alerts).
   Tokens from ivs-tokens.css, buttons from ivs-buttons.css (both global).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Root voice ── */
.ivs-aff {
    background: var(--v5-ivory, #faf9f6);
    color: var(--v5-ink, #201f1d);
    font-family: var(--v5-font-body, Georgia, serif);
    overflow-x: clip;
}
/* Links inherit the text colour; house buttons rendered as <a> keep their own. */
.ivs-aff a:not(.ivs-btn) { color: inherit; }
.ivs-aff a { text-decoration: none; }
.ivs-aff p { margin: 0 0 1rem; }

.ivs-aff-small {
    font-family: var(--v5-font-label, sans-serif);
    font-size: .82rem;
    color: var(--v5-stone, #5b574d);
}
.ivs-aff-link {
    color: var(--v5-olive-700, #4a5e2f);
    position: relative;
}
.ivs-aff-link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--ivs-anim-micro, 300ms) var(--ivs-anim-ease, ease);
}
.ivs-aff-link:hover::after,
.ivs-aff-link:focus-visible::after { transform: scaleX(1); }

/* Flash messages (Session alert-class) restyled from Bootstrap's coloured boxes
   to the house voice: parchment, hairline, an olive/brick rule on the left. */
.ivs-aff .alert {
    background: var(--v5-parchment, #f2efe8);
    border: 1px solid var(--v5-line, #e4e0d5);
    border-left: 3px solid var(--v5-olive-700, #4a5e2f);
    border-radius: 0;
    color: var(--v5-ink, #201f1d);
    padding: .9rem 1.1rem;
    margin: 0 0 1.4rem;
    font-size: .95rem;
    line-height: 1.5;
}
.ivs-aff .alert-danger { border-left-color: #9a3b2c; }
.ivs-aff .alert-warning { border-left-color: var(--v5-gold, #b9995b); }
.ivs-aff .alert p { margin: 0; }

/* ── Form voice ── */
.ivs-aff-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.4rem;
}
.ivs-aff-field { margin-bottom: 1.3rem; }
.ivs-aff-field--full { grid-column: 1 / -1; }
.ivs-aff-label {
    display: block;
    font-family: var(--v5-font-label, sans-serif);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--v5-ink, #201f1d);
    margin-bottom: .45rem;
}
.ivs-aff-label small {
    font-weight: 400;
    color: var(--v5-mist, #8b877c);
    margin-left: .35rem;
}
.ivs-aff .ivs-aff-ctl {
    display: block;
    width: 100%;
    font-family: var(--v5-font-body, Georgia, serif);
    font-size: 1rem;
    line-height: 1.4;
    color: var(--v5-ink, #201f1d);
    background: #fff;
    border: 1px solid var(--v5-line, #e4e0d5);
    border-radius: 0;
    padding: .78rem .95rem;
    transition: border-color var(--ivs-anim-micro, 300ms) ease, box-shadow var(--ivs-anim-micro, 300ms) ease;
    -webkit-appearance: none;
    appearance: none;
}
.ivs-aff .ivs-aff-ctl::placeholder { color: var(--v5-mist, #8b877c); }
.ivs-aff .ivs-aff-ctl:focus,
.ivs-aff .ivs-aff-ctl:focus-visible {
    outline: none;
    border-color: var(--v5-olive-500, #6b8051);
    box-shadow: 0 0 0 3px rgba(107, 128, 81, .18);
}
.ivs-aff textarea.ivs-aff-ctl { min-height: 7.5rem; resize: vertical; }
.ivs-aff-select { position: relative; }
.ivs-aff-select::after {
    content: '';
    position: absolute;
    right: 1rem; top: 50%;
    width: 8px; height: 8px;
    border-right: 1.5px solid var(--v5-stone, #5b574d);
    border-bottom: 1.5px solid var(--v5-stone, #5b574d);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}
.ivs-aff-select .ivs-aff-ctl { padding-right: 2.6rem; }
.ivs-aff-check {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    font-size: .92rem;
    line-height: 1.5;
    color: var(--v5-stone, #5b574d);
}
.ivs-aff-check input {
    flex: 0 0 auto;
    width: 18px; height: 18px;
    margin: .2rem 0 0;
    accent-color: var(--v5-olive-700, #4a5e2f);
}
.ivs-aff-check a { color: var(--v5-olive-700, #4a5e2f); text-decoration: underline; text-underline-offset: 2px; }
.ivs-aff-err {
    display: block;
    font-family: var(--v5-font-label, sans-serif);
    font-size: .8rem;
    color: #9a3b2c;
    margin-top: .4rem;
}
.ivs-aff-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.6rem;
    margin-top: .4rem;
}
.ivs-aff .ivs-btn { padding: .95rem 1.7rem; }
.ivs-aff .g-recaptcha { margin: .4rem 0 1.2rem; }

/* Password field with the show/hide control */
.ivs-aff-pw { position: relative; }
.ivs-aff-pw .ivs-aff-ctl { padding-right: 4.4rem; }
.ivs-aff-pw-toggle {
    position: absolute;
    right: .4rem; top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    font-family: var(--v5-font-label, sans-serif);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--v5-olive-700, #4a5e2f);
    padding: .5rem .6rem;
    cursor: pointer;
}

/* ── The sign-in card (layout app-blank: no site header, the card carries the logo) ── */
.ivs-afa {
    min-height: 100vh;
    min-height: 100svh;
    position: relative;
    background: var(--v5-parchment, #f2efe8);
    display: grid;
    place-items: center;
    padding: 2.5rem 1rem;
}
.ivs-afa::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../../images/italy-tile.webp') repeat;
    background-size: 620px;
    opacity: .14;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(80% 70% at 50% 50%, rgba(0,0,0,.25), #000);
    mask-image: radial-gradient(80% 70% at 50% 50%, rgba(0,0,0,.25), #000);
}
.ivs-afa-card {
    position: relative;
    z-index: 1;
    width: min(500px, 100%);
    background: var(--v5-ivory, #faf9f6);
    border: 1px solid var(--v5-line, #e4e0d5);
    padding: clamp(1.6rem, 4vw, 2.8rem);
    box-shadow: 0 24px 50px -34px rgba(32, 31, 29, .5);
}
.ivs-afa-logo { display: block; width: 190px; margin: 0 auto 1.6rem; }
.ivs-afa-logo img { display: block; width: 100%; height: auto; }
.ivs-afa-card .ivs-aff-h1 {
    font-family: var(--v5-font-display, Georgia, serif);
    font-weight: 500;
    line-height: 1.1;
    font-size: clamp(1.7rem, 3vw, 2.15rem);
    text-align: center;
    margin: 0 0 .5rem;
    text-wrap: balance;
}
.ivs-afa-sub { text-align: center; color: var(--v5-stone, #5b574d); margin-bottom: 1.6rem; }
.ivs-afa-needs {
    background: #fff8e3;
    border: 1px solid #efd9a0;
    border-left: 3px solid var(--v5-gold, #b9995b);
    padding: 1rem 1.1rem;
    margin-bottom: 1.4rem;
}
.ivs-afa-needs p { margin: 0 0 .5rem; }
.ivs-afa-needs strong { font-family: var(--v5-font-label, sans-serif); font-size: .9rem; }
.ivs-afa-needs .ivs-btn { margin-top: .4rem; padding: .7rem 1.2rem; }
.ivs-afa-card .ivs-btn { width: 100%; justify-content: center; }
.ivs-afa-foot {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--v5-line, #e4e0d5);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .6rem 1rem;
    font-family: var(--v5-font-label, sans-serif);
    font-size: .84rem;
    color: var(--v5-stone, #5b574d);
}
/* Second footer row: the "for help write here" note. */
.ivs-afa-help {
    margin-top: 1rem;
    font-family: var(--v5-font-label, sans-serif);
    font-size: .8rem;
    color: var(--v5-mist, #8b877c);
    text-align: center;
}
.ivs-afa-lang {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 2;
}
.ivs-afa-lang .dropdown-menu { left: auto; right: 0; }
.ivs-afa-lang img { width: 22px; height: auto; }
.ivs-afa-lang .dropdown-item img { width: 18px; margin-right: .4rem; }

@media (max-width: 720px) {
    .ivs-aff-grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .ivs-aff-link::after,
    .ivs-aff .ivs-aff-ctl { transition: none; }
}
