/**
 * CFRMS login / forgot-password pages — split-panel navy design.
 *
 * Depends on the CSS variables defined in cfrms-theme.css (loaded first).
 * The brand panel stays navy in both modes; the form panel follows the
 * light/dark surface variables.
 */

body.cfrms-login {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    /* Fixed dark backdrop for the network animation - independent of the
       light/dark toggle, same reasoning as the brand panel staying navy.
       !important needed: cfrms-theme.css sets body background !important
       for the internal app, and this selector must win over it here. */
    background: #04101f !important;
    font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding: 24px 12px;
}

#cfrmsNetworkBg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.cfrms-login-card {
    position: relative;
    z-index: 1;
    display: flex;
    width: 940px;
    max-width: 100%;
    min-height: 540px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: var(--cf-surface);
}

/* ---------- Brand panel (left) ---------- */
.cfrms-brand-panel {
    flex: 1.1;
    background: #042C53;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #E6F1FB;
}

.cfrms-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.cfrms-brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cfrms-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #185FA5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #E6F1FB;
}

.cfrms-brand-name {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #E6F1FB;
}

.cfrms-company-logo {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 6px 10px;
    max-height: 100px;
    display: flex;
    align-items: center;
}

.cfrms-company-logo img {
    max-height: 80px;
    max-width: 120px;
    display: block;
}

.cfrms-tagline-en {
    color: #B5D4F4;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* ---------- Feature slider (brand panel) ---------- */
.cfrms-slider-track {
    position: relative;
    min-height: 110px;
}

.cfrms-slide {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
}

.cfrms-slide-line {
    transform: translateX(-60px);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(.22,.9,.32,1), opacity 0.8s ease;
}

.cfrms-slide-line.is-active { transform: translateX(0); opacity: 1; }

.cfrms-slide-line.is-leaving {
    transform: translateX(60px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.3s ease;
}

.cfrms-slide-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #E6F1FB;
    margin-bottom: 6px;
}

.cfrms-slide-title i { font-size: 15px; }

.cfrms-slide-tagline {
    font-size: 13px;
    color: #9FE0C9;
    font-weight: 600;
    margin-bottom: 6px;
}

.cfrms-slide-desc {
    font-size: 12px;
    color: #85A9CB;
    line-height: 1.55;
}

.cfrms-slide-dots {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.cfrms-slide-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2C4A66;
    transition: background 0.3s ease;
}

.cfrms-slide-dot.is-current { background: #378ADD; }

.cfrms-features {
    display: flex;
    gap: 16px;
}

.cfrms-feature {
    flex: 1;
    border-left: 2px solid #378ADD;
    padding-left: 12px;
}

.cfrms-feature .cfrms-feature-icon {
    font-size: 18px;
    color: #E6F1FB;
    margin-bottom: 4px;
    display: block;
}

.cfrms-feature .cfrms-feature-text {
    font-size: 12px;
    color: #85B7EB;
    line-height: 1.4;
}

/* ---------- Form panel (right) ---------- */
.cfrms-form-panel {
    flex: 1;
    background: var(--cf-surface);
    padding: 36px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cfrms-form-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.cfrms-lang-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--cf-input-border);
    color: var(--cf-text-muted);
    text-decoration: none;
    line-height: 1;
}

.cfrms-lang-pill:hover {
    color: var(--cf-link);
    text-decoration: none;
    border-color: var(--cf-accent-bright);
}

.cfrms-lang-pill.active {
    background: var(--cf-accent-soft);
    color: var(--cf-link);
    border-color: var(--cf-accent);
}

.cfrms-mode-toggle {
    border: none;
    background: transparent;
    color: var(--cf-text-muted);
    font-size: 15px;
    cursor: pointer;
    padding: 4px 6px;
}

.cfrms-mode-toggle:hover { color: var(--cf-link); }

.cfrms-form-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--cf-text);
    margin: 0 0 4px;
}

.cfrms-form-subtitle {
    font-size: 13px;
    color: var(--cf-text-muted);
    margin: 0 0 22px;
}

.cfrms-field {
    position: relative;
    margin-bottom: 14px;
}

.cfrms-field .cfrms-field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cf-text-muted);
    font-size: 14px;
    pointer-events: none;
}

.cfrms-field input.form-control {
    height: 44px;
    padding-left: 38px;
    padding-right: 38px;
    border-radius: 8px;
    background: var(--cf-input-bg);
    border: 1px solid var(--cf-input-border);
    color: var(--cf-text);
    font-size: 14px;
    box-shadow: none;
}

.cfrms-field input.form-control:focus {
    border-color: var(--cf-accent-bright);
    box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.18);
}

/* Chrome autofill paints its own white background; force ours instead */
.cfrms-field input:-webkit-autofill,
.cfrms-field input:-webkit-autofill:hover,
.cfrms-field input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--cf-input-bg) inset;
    -webkit-text-fill-color: var(--cf-text);
    caret-color: var(--cf-text);
    transition: background-color 9999s ease-out;
}

.cfrms-toggle-password {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cf-text-muted);
    cursor: pointer;
    font-size: 14px;
}

.cfrms-toggle-password:hover { color: var(--cf-link); }

.cfrms-submit {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: #185FA5;
    color: #E6F1FB;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.15s ease;
}

.cfrms-submit:hover { background: #0C447C; }

.cfrms-form-links {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

.cfrms-form-links a { color: var(--cf-link); text-decoration: none; }
.cfrms-form-links a:hover { color: var(--cf-link-hover); text-decoration: underline; }

.cfrms-form-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 11px;
    color: var(--cf-text-muted);
    line-height: 1.6;
}

.cfrms-form-footer a { color: var(--cf-link); }

/* Ion Auth / validation messages */
#infoMessage {
    color: #E24B4A;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .cfrms-login-card { flex-direction: column; min-height: 0; }
    .cfrms-brand-panel { padding: 26px 24px; }
    .cfrms-features { display: none; }
    .cfrms-slider-track { display: none; }
    .cfrms-form-panel { padding: 28px 24px; }
}
