/* ============================================================================
 * Certopact brand stylesheet
 * Palette + typography from certopact-logo-pack BRAND-GUIDE.html
 * Applied across Client Portal (manage.certopact.com) + Admin Portal
 * ============================================================================ */

:root {
    --cream: #F3EEE4;
    --paper: #FBF7EE;
    --ink: #0B1220;
    --navy: #0B1F3A;
    --gold: #B08840;
    --gold-lt: #D4B271;
    --mid: #6B6860;
    --line: rgba(11, 18, 32, 0.10);
}

html, body {
    min-height: 100%;
}

body {
    background: var(--cream);
    color: var(--ink);
    font-family: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    color: var(--ink);
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.15;
}

h3 {
    font-size: 1.35rem;
}

h1 em,
h2 em,
h3 em {
    font-style: italic;
    color: var(--gold);
}

.lede {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: 1.125rem;
    color: var(--mid);
    line-height: 1.5;
}

.kicker {
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 11px;
    color: var(--mid);
}

a {
    color: var(--navy);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover,
a:focus {
    color: var(--gold);
}

/* Bootstrap overrides --------------------------------------------------- */

.btn-primary,
.btn-navy {
    background-color: var(--navy);
    border-color: var(--navy);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-navy:hover,
.btn-navy:focus {
    background-color: #061324;
    border-color: #061324;
    color: #fff;
}

.btn-outline-navy {
    color: var(--navy);
    border-color: var(--navy);
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-navy:hover,
.btn-outline-navy:focus {
    background-color: var(--navy);
    color: #fff;
}

.form-control,
.form-select {
    background-color: var(--paper);
    border-color: var(--line);
    color: var(--ink);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(176, 136, 64, 0.25);
}

.form-floating > label {
    color: var(--mid);
}

/* Layout + navigation --------------------------------------------------- */

.cp-topnav {
    background-color: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem;
}

.cp-topnav .cp-brand img {
    height: 28px;
    width: auto;
}

.cp-topnav .cp-user {
    color: var(--mid);
    font-size: 0.925rem;
}

.cp-footer {
    background-color: var(--cream);
    color: var(--mid);
    border-top: 1px solid var(--line);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 400;
}

.cp-footer a {
    color: var(--mid);
}

.cp-footer a:hover,
.cp-footer a:focus {
    color: var(--gold);
}

/* Cards + tiles --------------------------------------------------------- */

.cp-tile.card {
    background-color: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.cp-tile .cp-tile-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    color: var(--mid);
    margin-bottom: 0.5rem;
}

.cp-tile .cp-tile-value {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    font-size: 2.25rem;
    color: var(--gold);
    line-height: 1;
}

.cp-tile .cp-tile-foot {
    color: var(--mid);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

/* Usage progress thresholds (Round D will flip data in) */
.cp-usage-bar {
    height: 6px;
    background-color: var(--line);
    border-radius: 3px;
    overflow: hidden;
}

.cp-usage-bar-fill {
    height: 100%;
    background-color: var(--navy);
}

.cp-usage-threshold-amber .cp-usage-bar-fill {
    background-color: var(--gold);
}

.cp-usage-threshold-red .cp-usage-bar-fill {
    background-color: #B04040;
}

/* Login split layout ---------------------------------------------------- */

.cp-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 960px) {
    .cp-login-shell {
        grid-template-columns: 1fr;
    }
}

.cp-login-hero {
    position: relative;
    background-image: url('/img/login/lobby-hero.jpg');
    background-size: cover;
    background-position: center center;
    min-height: 100vh;
}

/* Dark vignette so caption text is always legible against the bright lobby photo */
.cp-login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(11, 18, 32, 0.18) 0%,
        rgba(11, 18, 32, 0.04) 100%
    );
    pointer-events: none;
}

.cp-login-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 50%;
    background: linear-gradient(to top, rgba(11, 18, 32, 0.62), rgba(11, 18, 32, 0));
    pointer-events: none;
}

.cp-login-hero-caption {
    position: absolute;
    left: 2rem;
    bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    z-index: 1;
}

.cp-login-form {
    background-color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.cp-login-form-inner {
    width: 100%;
    max-width: 420px;
}

.cp-login-logo {
    height: 32px;
    width: auto;
    margin-bottom: 1.75rem;
}

/* Alerts -------------------------------------------------------------- */

.alert-danger {
    background-color: #FBECEC;
    border-color: #E4A2A2;
    color: #7A2323;
}

/* Misc ---------------------------------------------------------------- */

.text-gold {
    color: var(--gold) !important;
}

.bg-paper {
    background-color: var(--paper) !important;
}

/* Focus ring default */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Secondary nav --------------------------------------------------------- */

.cp-subnav {
    background-color: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0 1.25rem;
    display: flex;
    gap: 0;
}

.cp-subnav-link {
    display: inline-block;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mid);
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

.cp-subnav-link:hover,
.cp-subnav-link:focus {
    color: var(--navy);
    border-bottom-color: var(--gold-lt);
}

.cp-subnav-link.active {
    color: var(--navy);
    border-bottom-color: var(--gold);
    font-weight: 600;
}

/* Role + status badges --------------------------------------------------- */

.cp-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 4px;
    font-weight: 500;
}

.cp-badge-owner   { background: #E8F0FF; color: #1B3A8A; }
.cp-badge-admin   { background: #EDF5E8; color: #275218; }
.cp-badge-plant   { background: #F5F0E8; color: #5C4010; }
.cp-badge-user    { background: #F0F0F0; color: #444;    }
.cp-badge-active  { background: #E8F5EC; color: #1A6632; }
.cp-badge-inactive{ background: #FCE8E8; color: #7A2323; }

/* TempData alerts ------------------------------------------------------- */

.alert-success {
    background-color: #EAF5EC;
    border-color: #A5D6B0;
    color: #1A6632;
}

.alert-info {
    background-color: #E8F0FB;
    border-color: #A5C0E8;
    color: #1B3A8A;
}

/* Verification status indicators ---------------------------------------- */

.cp-status-matched    { color: #1A6632; font-weight: 700; }
.cp-status-notmatched { color: #7A2323; font-weight: 700; }
.cp-status-pending    { color: var(--mid); font-weight: 600; }
.cp-status-failed     { color: #7A2323; font-weight: 700; }

.cp-score-bar {
    height: 8px;
    background: var(--line);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.375rem;
}

.cp-score-bar-fill {
    height: 100%;
    background: var(--navy);
    transition: width 0.4s ease;
}

.cp-score-bar-fill.threshold-green { background: #2D7D46; }
.cp-score-bar-fill.threshold-amber { background: var(--gold); }
.cp-score-bar-fill.threshold-red   { background: #B04040; }

/* Pending pulse animation */
@keyframes cp-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.cp-pending-pulse {
    animation: cp-pulse 2s ease-in-out infinite;
}

/* ── Password visibility toggle ───────────────────────────────────────────── */
/* Wrapper: just adds relative positioning so the button can be absolute. */
.cp-pwd-wrap {
    position: relative;
}
/* Push the text away from the eye button so the two don't overlap. */
.cp-pwd-wrap input.form-control {
    padding-right: 2.75rem;
}
/* The toggle button sits on the right, vertically centred in the field. */
.cp-pwd-toggle {
    position: absolute;
    right: 0.875rem;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--mid);
    z-index: 5;
    transition: color .15s;
}
.cp-pwd-toggle:hover,
.cp-pwd-toggle:focus-visible { color: var(--ink); outline: none; }
.cp-pwd-toggle svg            { width: 18px; height: 18px; display: block; }

/* ── Toast notifications ──────────────────────────────────────────────────── */
.cp-toast-wrap {
    position: fixed;
    top: 76px;          /* clears the top-nav */
    right: 1.25rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 2.5rem));
}

.cp-toast {
    pointer-events: all;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    box-shadow: 0 8px 28px rgba(11,18,32,.14);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .22s ease, transform .22s ease;
}

.cp-toast.cp-toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.cp-toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.cp-toast-body {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ink);
}

.cp-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    color: var(--mid);
    font-size: 1.05rem;
    line-height: 1;
    transition: color .15s;
}
.cp-toast-close:hover { color: var(--ink); }

.cp-toast--success { border-left: 3px solid #2D7D46; }
.cp-toast--error   { border-left: 3px solid #B04040; }
.cp-toast--info    { border-left: 3px solid var(--gold); }
.cp-toast--warning { border-left: 3px solid var(--gold-lt); }
