﻿/* ==========================================================================
   auth-theme.css : Login / Register / Forgot password / Reset password / OTP pages (_LayoutLogReg)
   Same look as the survey bank and service forms (css/form/form.css "fx" theme):
   lavender header band, indigo (var(--ui-primary, #2b1a63)) buttons, gold accent, Poppins, 14px rounded cards.
   No inline css/js is used on these pages: everything is in this file and js/auth-theme.js.
   ========================================================================== */
:root {
    --au-head-bg: var(--ui-primary-soft,#e8e4f5);
    --au-head-ink: var(--ui-primary,#2b1a63);
    --au-head-line: var(--ui-head-line,#cbc2e8);
    --au-navy-800: var(--ui-primary,#2b1a63);
    --au-blue-600: var(--ui-primary, #2b1a63);
    --au-blue-500: var(--ui-primary-light,#5b3fb0);
    --au-violet-400: var(--ui-icon-soft, #8f77d8);
    --au-gold: #f8b940;
    --au-ink: var(--ui-ink,#1f1a3d);
    --au-ink-2: var(--ui-ink-2,#443f66);
    --au-muted: var(--ui-muted,#6f6a8f);
    --au-line: var(--ui-line,#ddd8ee);
    --au-line-2: var(--ui-line-soft,#ece9f6);
    --au-field: var(--ui-bg,#f7f6fc);
    --au-ring: 0 0 0 4px color-mix(in srgb, var(--ui-primary, #2b1a63) 16%, transparent);
    --au-shadow: 0 2px 4px color-mix(in srgb, var(--ui-primary, #2b1a63) 6%, transparent), 0 18px 44px color-mix(in srgb, var(--ui-primary, #2b1a63) 16%, transparent);
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--au-head-bg);
    min-height: 100vh;
    font-family: poppins, "Segoe UI", sans-serif;
}

#preloader {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 999999;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- page + card ---------- */
.cp-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: end;
    position: relative;
    padding: 32px 16px;
    font-family: poppins, "Segoe UI", sans-serif;
    background: var(--ui-login-bg, url("../images/background-imagess.jpg")) no-repeat;
    background-size: cover;
    background-position: var(--ui-login-bg-pos, 0 0);
}

    /* indigo wash over the photo so the page matches the rest of the application */
    .cp-login-wrap::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        background: linear-gradient(135deg, color-mix(in srgb, var(--ui-primary-dark, #1d1042) 42%, transparent), color-mix(in srgb, var(--ui-primary, #2b1a63) 18%, transparent));
    }

/* photo carousel (auth-theme.js fills it from --ui-login-slides); sits under the colour wash (::after) and under the card */
.cp-slides { position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.cp-slide { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background-size: cover; background-repeat: no-repeat; opacity: 0; transition: opacity 1.4s ease-in-out; }
.cp-slide.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .cp-slide { transition: none; } }

.cp-form-panel {
    background: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: 14px;
    box-shadow: var(--au-shadow);
    border: 1px solid var(--au-line-2);
    overflow: hidden;
    position: relative;
    z-index: 99;
    right: 250px;
}

/* ---------- brand band (same lavender band as the page headers) ---------- */
.cp-brand {
    /* same colour as the top row (.header) of the application layout */
    background: var(--au-navy-800);
    color: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 24px 17px;
    overflow: hidden;
}

    /* gold line at the bottom of the header: gold in the middle, fading into the lavender band at both ends */
    .cp-brand::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 3px;
        background: linear-gradient(90deg, rgba(248, 185, 64, 0) 0%, #e8a317 22%, var(--au-gold) 50%, #e8a317 78%, rgba(248, 185, 64, 0) 100%);
    }

.cp-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    /* title + subtitle sit as one block at the bottom of the logo (a little above its lower edge) */
    align-items: flex-end;
    margin-left: -18px;
}

.cp-brand-logo {
    width: 84px;
    height: auto;
    margin-bottom: 0;
    margin-right: 26px;
    filter: drop-shadow(0 0 14px rgba(248, 185, 64, .28)) drop-shadow(0 4px 10px rgba(0, 0, 0, .4));
    transform-origin: center center;
}

.cp-brand-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 22px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    margin-bottom: 13px;
}

.cp-brand-sub {
    font-size: 13px;
    letter-spacing: .25px;
    color: var(--ui-line,#d9d2f1);
    line-height: 18px;
    margin-top: 7px;
    font-weight: 500;
    /* the subtitle sits inside the title element: do not inherit its caps and shadow */
    text-transform: none;
    text-shadow: none;
}

/* ---------- body ---------- */
.cp-form-body {
    padding: 26px 32px 22px;
}

.cp-form-head {
    margin-bottom: 16px;
}

.cp-form-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--au-navy-800);
}

.cp-form-desc {
    font-size: 13px;
    color: var(--au-muted);
    margin-top: 3px;
}

.cp-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

    .cp-alert.success {
        background: #ecfdf5;
        border: 1px solid #86efac;
        color: #15803d;
    }

    .cp-alert.warning {
        background: #fff8e8;
        border: 1px solid #f3d189;
        color: #8a5a00;
    }

.cp-field {
    margin-bottom: 14px;
}

.cp-label,
.cp-form-body .control-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--au-ink-2);
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 5px;
}

.cp-input-wrap {
    position: relative;
}

.cp-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--au-violet-400);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}

.cp-input,
.cp-form-body .form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border: 1.5px solid var(--au-line);
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--au-ink);
    background: var(--au-field);
    transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
    outline: none;
    box-sizing: border-box;
}

.cp-form-body .form-control {
    padding-left: 12px;
}

    .cp-input:focus,
    .cp-form-body .form-control:focus {
        border-color: var(--au-blue-600);
        background: #fff;
        box-shadow: var(--au-ring);
    }

.cp-input-err {
    font-size: 11px;
    color: #d4343f;
    margin-top: 3px;
}

/* ---------- captcha: ONE component on every page (Login, Register, Reset password, Verify account) ----------
   [ code input ][ captcha image | refresh ]  - the image and its refresh button are one joined box */
.cp-captcha {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

    .cp-captcha .cp-input-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }

/* bigger, easier to type: larger text, wide letter spacing */
.cp-captcha-input,
.cp-form-body .cp-captcha-input {
    height: 48px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 3px;
    padding-left: 40px;
}

    .cp-captcha-input::placeholder {
        font-size: 14px;
        font-weight: 400;
        letter-spacing: .3px;
    }

.cp-captcha-box {
    display: flex;
    flex: none;
    height: 48px;
    border: 1.5px solid var(--au-line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

    .cp-captcha-box .cp-captcha-img {
        display: block;
        height: 100%;
        width: auto;
        border: 0;
        border-radius: 0;
        margin: 0;
    }

.cp-captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    padding: 0;
    border: 0;
    border-left: 1.5px solid var(--au-line);
    border-radius: 0;
    background: var(--au-field);
    color: var(--au-blue-600);
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

    .cp-captcha-refresh:hover,
    .cp-captcha-refresh:focus-visible {
        background: var(--ui-primary-soft,#ede8fa);
        color: var(--au-navy-800);
        outline: none;
    }

    .cp-captcha-refresh:active .fa {
        transform: rotate(180deg);
    }

    .cp-captcha-refresh .fa {
        transition: transform .25s ease;
    }

/* ---------- buttons ---------- */
.cp-submit {
    width: 100%;
    height: 42px;
    color: #fff;
    background: linear-gradient(135deg, var(--au-blue-500), var(--au-blue-600) 55%, var(--ui-primary-end,#33206f));
    border: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--ui-primary, #2b1a63) 32%, transparent);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .cp-submit:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 9px 20px color-mix(in srgb, var(--ui-primary, #2b1a63) 42%, transparent);
    }

    .cp-submit:active:not(:disabled) {
        transform: translateY(0);
    }

    .cp-submit:disabled {
        opacity: .7;
        cursor: not-allowed;
        transform: none;
    }

    .cp-submit.secondary {
        background: #fff;
        color: var(--au-navy-800);
        border: 1.5px solid var(--au-line);
        box-shadow: none;
    }

        .cp-submit.secondary:hover:not(:disabled) {
            background: var(--ui-bg,#f4f1fc);
            border-color: var(--ui-primary-mid,#bdb3dc);
            color: var(--au-blue-600);
            box-shadow: none;
            transform: none;
        }

.cp-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
}

    .cp-divider::before,
    .cp-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--au-line-2);
    }

    .cp-divider span {
        font-size: 11px;
        color: var(--au-muted);
        white-space: nowrap;
    }

/* the link buttons (Login / Register / Return to Home ...) always sit in ONE row, however many there are */
.cp-links {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 8px;
}

.cp-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1.5px solid var(--au-line);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--au-navy-800);
    text-decoration: none;
    background: #fff;
    transition: border-color .15s, background .15s, color .15s;
}

    .cp-link-btn:hover {
        border-color: var(--ui-primary-mid,#bdb3dc);
        color: var(--au-blue-600);
        background: var(--ui-bg,#f4f1fc);
        text-decoration: none;
    }

    .cp-link-btn.full {
        background: var(--au-field);
    }

.cp-form-footer {
    margin-top: 20px;
    font-size: 11px;
    color: var(--au-muted);
    text-align: center;
}

/* ---------- login / OTP tab switcher ---------- */
.cp-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--ui-bg,#f1eefa);
    border: 1px solid var(--au-line-2);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 20px;
}

.cp-tab-btn {
    border: none;
    background: transparent;
    padding: 9px 8px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--au-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s, color .15s;
}

    .cp-tab-btn.active {
        background: linear-gradient(135deg, var(--au-blue-500), var(--au-blue-600) 55%, var(--ui-primary-end,#33206f));
        color: #fff;
        box-shadow: 0 4px 10px color-mix(in srgb, var(--ui-primary, #2b1a63) 28%, transparent);
    }

.cp-tab-pane {
    display: none;
}

    .cp-tab-pane.active {
        display: block;
    }

.cp-otp-timer {
    font-size: 11.5px;
    color: var(--au-muted);
    margin-top: 6px;
    text-align: right;
}

    .cp-otp-timer.active {
        color: var(--au-blue-600);
        font-weight: 600;
    }

/* ---------- utility classes ---------- */
.cp-hidden {
    display: none;
}

.cp-mt-8 {
    margin-top: 8px;
}

.cp-validation-summary {
    font-size: 12.5px;
    margin-bottom: 12px;
}

/* ---------- Register: password strength ---------- */
.pwd-input-wrap {
    position: relative;
}

.pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--au-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color .15s ease;
}

    .pwd-toggle:hover {
        color: var(--au-blue-600);
    }

.pwd-meter {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    height: 5px;
}

.pwd-meter-seg {
    flex: 1;
    border-radius: 3px;
    background: var(--au-head-bg);
    transition: background-color .3s ease, transform .3s ease;
    transform-origin: left;
}

.pwd-meter-label {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    letter-spacing: .2px;
    transition: color .25s ease;
    min-height: 16px;
}

.pwd-checklist {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
}

    .pwd-checklist li {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 12.5px;
        color: var(--au-muted);
        transition: color .25s ease;
    }

.pwd-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--au-line);
    flex-shrink: 0;
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
    position: relative;
}

    .pwd-check-icon::after {
        content: "";
        position: absolute;
        left: 4.5px;
        top: 1.5px;
        width: 4px;
        height: 8px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg) scale(0);
        transition: transform .2s ease;
    }

.pwd-checklist li.pwd-ok {
    color: #17824b;
}

    .pwd-checklist li.pwd-ok .pwd-check-icon {
        background-color: #17a24a;
        border-color: #17a24a;
        transform: scale(1.06);
    }

        .pwd-checklist li.pwd-ok .pwd-check-icon::after {
            transform: rotate(45deg) scale(1);
        }

.pwd-match-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    margin-top: 8px;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: opacity .2s ease, height .2s ease;
}

    .pwd-match-msg.show {
        height: 18px;
        opacity: 1;
    }

    .pwd-match-msg.ok {
        color: #17824b;
    }

    .pwd-match-msg.bad {
        color: #c0392b;
    }

/* collapsible panel: keeps the resting form short */
.pwd-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.4, 0, .2, 1), opacity .25s ease, margin-top .35s ease;
}

    .pwd-panel.pwd-panel-open {
        max-height: 220px;
        opacity: 1;
        margin-top: 10px;
    }

.pwd-panel-inner {
    background: var(--au-field);
    border: 1px solid var(--au-line-2);
    border-radius: 10px;
    padding: 12px 14px 10px;
}

.pwd-hint-line {
    font-size: 11.5px;
    color: var(--au-muted);
    margin-top: 4px;
    transition: opacity .2s ease;
}

/* gentle entrance for each field on Register */
.cp-field {
    opacity: 0;
    animation: cpFieldIn .45s ease forwards;
}

@keyframes cpFieldIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991px) {
    .cp-form-panel {
        right: 0;
    }
}

@media (max-width: 520px) {
    .cp-brand-logo {
        width: 60px;
    }

    .cp-brand-sub {
        font-size: 12px;
        line-height: 14px;
        margin-top: 8px;
    }

    .cp-brand-title {
        font-size: 20px;
    }

/* Captcha row on small screens: the code box and the picture never overlap (login, OTP login, reset password, verify account, register).
   Phones: the picture (with its refresh button) on top, the code box full width below it. */
.cp-captcha { flex-wrap: wrap; }
.cp-captcha .cp-input-wrap { flex: 1 1 150px; min-width: 150px; }
.cp-captcha-box { flex: 0 0 auto; max-width: 100%; }
.cp-captcha-box .cp-captcha-img { max-width: 100%; object-fit: contain; }
@media (max-width: 480px) {
    .cp-captcha { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
    .cp-captcha .cp-input-wrap { flex: 0 0 auto; min-width: 0; width: 100%; }
    .cp-captcha-box { width: 100%; justify-content: space-between; }
    .cp-captcha-box .cp-captcha-img { flex: 1 1 auto; min-width: 0; width: auto; max-width: calc(100% - 46px); margin: 0 auto; }
    .cp-captcha-refresh { flex: 0 0 46px; }
}
