/* ==========================================================
   IFTS Client Portal — shared auth pages stylesheet
   Matches the finalized "Portal Login Page" design mockup:
   light gray page, white card, navy headings, blue primary
   button, IFTS brand logo.
   ========================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --navy: #0d1b4b;
    --blue-primary: #1a2f7f;
    --blue-btn: #1e2f8f;
    --blue-link: #2149c9;
    --page-bg: #f3f5f9;
    --card-border: #e6e9f0;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --danger: #c0261f;
    --danger-bg: #fdecea;
    --danger-border: #f6c6c2;
    --success: #1a9c5c;
    --success-bg: #e9f8ef;
    --info-bg: #eef1fb;
    --radius: 12px;
    --font-head: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--navy);
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.auth-wrap { width: 100%; max-width: 500px; }

.auth-topbar { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 4px; }
.lang-pill {
    border: 1px solid var(--card-border); background: #fff; border-radius: 20px;
    padding: 7px 14px; font-size: 12.5px; color: var(--navy); font-weight: 500;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 38px 34px;
    box-shadow: 0 8px 30px rgba(13,27,75,0.06);
}

.auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo img { height: 46px; }

.auth-card h2 { font-family: var(--font-head); font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; letter-spacing: -0.3px; }
.auth-card .subtitle { text-align: center; color: var(--gray-500); font-size: 13.5px; margin-bottom: 26px; }

.auth-error, .auth-success, .auth-info {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 13px 15px; border-radius: 10px;
    font-size: 13px; margin-bottom: 20px; line-height: 1.5;
}
.auth-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.auth-error strong { display: block; margin-bottom: 2px; font-size: 13.5px; }
.auth-success { background: var(--success-bg); border: 1px solid #bfe8cf; color: var(--success); }
.auth-info { background: var(--info-bg); border: 1px solid #dbe1f7; color: #334155; }

.field-row { display: flex; gap: 12px; }
.field-row .field-group { flex: 1; }

.field-group { position: relative; margin-bottom: 18px; }
.field-group label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }

.input-wrap { position: relative; display: flex; }
.input-wrap.with-prefix .prefix {
    display: flex; align-items: center; gap: 4px;
    padding: 0 12px; border: 1px solid var(--card-border); border-right: none;
    border-radius: 9px 0 0 9px; background: #f8f9fc; color: var(--gray-500); font-size: 13.5px; font-weight: 600;
}
.input-wrap .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 14px; pointer-events: none; }
.input-wrap input {
    flex: 1; width: 100%; padding: 12px 42px 12px 40px;
    background: #fff; border: 1px solid var(--card-border);
    border-radius: 9px; font-family: var(--font-body); font-size: 14px; color: var(--navy); outline: none;
    transition: all 0.2s;
}
.input-wrap.with-prefix input { border-radius: 0 9px 9px 0; padding-left: 14px; }
.input-wrap.with-prefix .input-icon { display: none; }
.input-wrap input::placeholder { color: var(--gray-400); }
.input-wrap input:focus { border-color: var(--blue-link); box-shadow: 0 0 0 3px rgba(33,73,201,0.12); }
.input-wrap input.invalid { border-color: var(--danger); }
.input-wrap input.invalid:focus { box-shadow: 0 0 0 3px rgba(192,38,31,0.12); }
.field-error-msg { display: none; color: var(--danger); font-size: 12px; margin-top: 6px; }
.field-error-msg.show { display: block; }

.toggle-pw {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 15px; padding: 4px; line-height: 1;
}
.toggle-pw:hover { color: var(--navy); }

.field-hint { font-size: 12px; color: var(--gray-500); margin-top: 6px; }

.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #334155; margin-bottom: 16px; line-height: 1.5; }
.check-row input { margin-top: 3px; }
.check-row a { color: var(--blue-link); text-decoration: none; font-weight: 600; }
.check-row a:hover { text-decoration: underline; }

.auth-row-meta { display: flex; align-items: center; justify-content: flex-end; margin: 0 0 20px; font-size: 12.5px; }
.auth-row-meta a { color: var(--blue-link); text-decoration: none; font-weight: 600; }
.auth-row-meta a:hover { text-decoration: underline; }

.auth-btn {
    width: 100%; padding: 13px; background: var(--blue-btn);
    color: #fff; border: none; border-radius: 9px;
    font-family: var(--font-body); font-size: 14.5px; font-weight: 700; cursor: pointer;
    transition: all 0.18s; letter-spacing: 0.2px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { background: #16256e; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-btn.outline { background: #fff; color: var(--blue-btn); border: 1px solid var(--card-border); }
.auth-btn.outline:hover { background: #f8f9fc; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--gray-400); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--card-border); }

.auth-foot-note { text-align: center; margin-top: 22px; font-size: 13px; color: var(--gray-500); }
.auth-foot-note a { color: var(--blue-link); text-decoration: none; font-weight: 600; }
.auth-foot-note a:hover { text-decoration: underline; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-link); text-decoration: none; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.back-link:hover { text-decoration: underline; }

.security-note {
    margin-top: 22px; background: #f8f9fc; border: 1px solid var(--card-border);
    border-radius: 12px; padding: 14px 16px; font-size: 12px; color: var(--gray-500); line-height: 1.6;
    display: flex; gap: 10px;
}
.security-note strong { color: var(--navy); display: block; margin-bottom: 2px; font-size: 12.5px; }

/* OTP step indicator */
.step-pill {
    display: inline-block; background: #eef1fb; color: var(--blue-link);
    font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 20px;
    letter-spacing: 0.4px; margin-bottom: 10px;
}
.step-wrap { text-align: center; margin-bottom: 6px; }

/* OTP digit boxes */
.otp-boxes { display: flex; gap: 8px; margin-top: 8px; }
.otp-boxes input {
    width: 44px; height: 48px; text-align: center; font-size: 18px; font-weight: 700;
    border: 1px solid var(--card-border); border-radius: 9px; color: var(--navy);
}
.otp-boxes input:focus { outline: none; border-color: var(--blue-link); box-shadow: 0 0 0 3px rgba(33,73,201,0.12); }
.otp-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--gray-500); }
.otp-meta .expiry { color: var(--blue-link); font-weight: 700; }
.otp-channel-label { font-size: 12.5px; font-weight: 700; color: var(--navy); margin-bottom: 8px; display:flex; align-items:center; gap:6px; }

/* Password strength */
.strength-bar { height: 5px; background: #eef1f6; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.strength-bar .fill { height: 100%; width: 0%; background: var(--danger); transition: all 0.25s; }
.strength-rules { list-style: none; margin-top: 10px; font-size: 12px; color: var(--gray-500); }
.strength-rules li { padding: 2px 0; }
.strength-rules li.ok { color: var(--success); }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.success-icon {
    width: 60px; height: 60px; border-radius: 50%; background: var(--success);
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px;
    margin: 0 auto 18px;
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
    .field-row { flex-direction: column; gap: 0; }
    .otp-boxes input { width: 38px; height: 44px; }
}
