/* ===========================================================================
   Client Portal (.NET) — theme + login, matched to the original Angular design.
   Tokens live here; change them to re-theme the whole app.
   =========================================================================== */
:root {
    --primary-color: #7a1f2b;        /* Carisma maroon */
    --primary-color-dark: #5c1620;
    --accent: #e09304;
    --ink: #2b2f36;
    --muted: #8a8f99;
    --border-light-color: #d9dde3;
    --danger: #e23b3b;
}

html, body {
    margin: 0;
    height: 100%;
    font-family: 'Source Sans 3', 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
}

.ff-garamond { font-family: 'EB Garamond', serif !important; }

/* ============================ Auth container ============================= */
.authentication-container {
    height: 100vh;
    min-height: 640px;
    position: relative;
    overflow: hidden;
}

.authentication-container .bg-white-left-gradient {
    position: absolute;
    left: 0; right: 0; bottom: 0; top: 0;
    background: linear-gradient(to right, #FFF 40%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
    backdrop-filter: blur(30px);
}

/* Left column content sits above the gradient (main row only — not the
   nested content/footer rows, or they'd trap the dropdown panel's z-index) */
.authentication-container > .row { position: relative; z-index: 2; }

/* ---- Brand logo ---- */
.auth-logo { height: 34px; width: auto; }

/* ---- "Client Portal" display title (left) ---- */
.auth-portal-title {
    font-weight: 300;
    letter-spacing: .2px;
    color: #3a3f46;
}

/* ---- Welcome block ---- */
.auth-welcome-title { font-size: 1.5rem; font-weight: 600; }
.auth-welcome-sub { color: var(--muted); font-size: .95rem; }

/* ---- Fields ---- */
.cp-field { margin-bottom: 1rem; }

.cp-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .4rem;
}

.cp-label { font-size: .9rem; font-weight: 600; color: #4b5059; }
.cp-required { color: var(--danger); font-weight: 700; }

.cp-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: .98rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border-light-color);
    border-radius: 6px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.cp-input::placeholder { color: #aab0ba; }
.cp-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(122, 31, 43, .12);
}

.cp-pw-wrap { position: relative; }
.cp-pw-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: .82rem; font-weight: 600; padding: 4px 6px;
}
.cp-pw-toggle:hover { color: var(--primary-color); }

.cp-field-error { margin-top: .35rem; font-size: .8rem; color: var(--danger); }
.cp-field-helper { margin-top: .4rem; font-size: .82rem; color: var(--muted); text-align: left; }

/* ---- Material Symbols icon ---- */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ---- OTP page bits ---- */
.otp-timer {
    font-weight: 700;
    color: #6b7280;
    opacity: .85;
    font-size: .95rem;
}
.otp-timer .material-symbols-rounded { font-size: 20px; }

.otp-expired {
    font-weight: 500;
    color: var(--danger);
    font-size: .9rem;
}

/* ---- Primary button ---- */
.btn-cp {
    width: 100%;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn-cp:hover:not(:disabled) { background: var(--primary-color-dark); }
.btn-cp:active:not(:disabled) { transform: translateY(1px); }
.btn-cp:disabled { opacity: .55; cursor: not-allowed; }

.btn-cp-link {
    background: none; border: none; cursor: pointer;
    color: var(--primary-color); font-weight: 600; font-size: .95rem; padding: 4px 8px;
}
.btn-cp-link:hover { text-decoration: underline; }

/* ---- Spinner ---- */
.cp-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff; border-radius: 50%;
    animation: cp-spin .7s linear infinite;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }

/* ---- Alert ---- */
.cp-alert { border-radius: 8px; padding: 10px 14px; font-size: .9rem; margin-bottom: 1rem; }
.cp-alert-success { background: #e9f7ef; color: #1c6b3c; border: 1px solid #bfe6cd; }
.cp-alert-danger  { background: #fdecec; color: #a12727; border: 1px solid #f5c6c6; }

/* ---- Contact + footer ---- */
.auth-contact { font-size: .85rem; opacity: .8; }
.br-bottom-dashed-lighter {
    border-bottom: 1px dashed rgba(0,0,0,.25);
    color: var(--primary-color);
}
.auth-footer { font-size: .82rem; color: var(--muted); }

/* ============================ Right card ================================ */
.authentication-container .card {
    height: 90vh;
    width: 100%;
    border: 0;
    border-radius: 25px;
    overflow: hidden;
    transform: translateX(35px);
    box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}

.authentication-container .card .card-img { height: 100%; object-fit: cover; }

.authentication-container .card .card-img-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 1%, transparent, transparent 90%);
}

.authentication-container .card .card-body-content {
    text-shadow: rgba(0, 0, 0, 0.4) 0px 2px 5px !important;
}

.authentication-container .card .badge-cp {
    padding: 7px 10px 5px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    background: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.7));
    color: #fff;
    text-shadow: rgba(0, 0, 0, 0.2) 0px 2px 5px;
}

.color-light { color: #fff; }
.opacity-90 { opacity: .9; }

/* ---- Responsive: hide the right card on small screens ---- */
@media (max-width: 767px) {
    .authentication-container .card-col { display: none; }
    .authentication-container .bg-white-left-gradient {
        background: rgba(255, 255, 255, 0.85);
    }
}

/* ---- Choose-a-client screen (post-OTP) ---- */
.sc-screen {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: #f4f5f8 url('/assets/images/login-banner-1.jpg') center/cover no-repeat;
}
.sc-screen::before { content: ""; position: fixed; inset: 0; background: rgba(255,255,255,.72); backdrop-filter: blur(6px); }
.sc-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 460px;
    background: #fff; border-radius: 18px;
    box-shadow: 0 24px 60px rgba(16,24,40,.18);
    padding: 30px 30px 24px;
}
.sc-card__brand { text-align: center; margin-bottom: 14px; }
.sc-card__brand img { height: 38px; width: auto; }
.sc-card__head { text-align: center; margin-bottom: 18px; }
.sc-card__head h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.sc-card__head p { color: var(--muted); margin: 0; font-size: .92rem; }

.sc-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-right: 2px; }
.sc-list::-webkit-scrollbar { width: 7px; }
.sc-list::-webkit-scrollbar-thumb { background: #d8dce3; border-radius: 4px; }
.sc-item {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    padding: 11px 13px; border: 1px solid var(--border-light-color); border-radius: 10px;
    background: #fff; cursor: pointer; font-size: .92rem; color: var(--ink);
    transition: background .12s, border-color .12s;
}
.sc-item:hover:not(:disabled) { background: var(--brand-tint, #f6ecee); border-color: var(--primary-color); }
.sc-item:disabled { opacity: .6; cursor: default; }
.sc-item .material-symbols-rounded { font-size: 20px; color: var(--primary-color); }
.sc-item__name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-item__chev { color: var(--muted) !important; }
.mb-3 { margin-bottom: 1rem; }

/* ---- Choose-a-client: dropdown trigger (auth page) ---- */
.cdd-auth-trigger { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cdd-auth-trigger .cdd__value { flex: 1; max-width: none; }
.cdd-auth-chev { color: var(--muted); font-size: 22px; margin-left: auto; }

/* ---- Choose-a-client: trigger icons + search ---- */
.cdd-auth-icons { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.cdd-caret { font-size: 26px; color: #6b7280; }
.cdd-refresh {
    background: none; border: none; cursor: pointer; padding: 2px;
    display: inline-flex; align-items: center; color: var(--primary-color);
}
.cdd-refresh:hover { color: var(--primary-color-dark, #5c1620); }
.cdd-refresh .material-symbols-rounded { font-size: 20px; }
.spin { animation: cp-spin .8s linear infinite; }

.cdd__search-wrap {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid #e6e8ee; border-radius: 8px; padding: 0 11px; margin-bottom: 6px;
}
.cdd__search-wrap .material-symbols-rounded { font-size: 18px; color: var(--muted); }
.cdd__search-input {
    flex: 1; border: none; outline: none; height: 38px;
    font-size: .9rem; background: transparent; color: var(--ink);
}
.cdd__search-input::placeholder { color: var(--muted); }

/* ---- disabled dropdown trigger (partner before client) ---- */
.cdd-auth-trigger.is-disabled { background: #f5f6f8; cursor: not-allowed; opacity: .75; }
.cdd-auth-trigger.is-disabled .cdd__value { color: var(--muted); }
