/* =============================================================
   Customer Panel Manager — Frontend Styles
   Light design — works on white page backgrounds.
   Gold (#b8963e) accent consistent with GM Solution Hub brand.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --cpm-gold:        #b8963e;
    --cpm-gold-light:  #d4af60;
    --cpm-gold-dim:    rgba(184,150,62,.15);
    --cpm-dark:        #1a1a2a;
    --cpm-text:        #2c2c3a;
    --cpm-text-muted:  #6b7280;
    --cpm-border:      #e4e4e8;
    --cpm-bg:          #f9f9fb;
    --cpm-white:       #ffffff;
    --cpm-error-bg:    #fef2f2;
    --cpm-error-text:  #7f1d1d;
    --cpm-error-line:  #c0392b;
    --cpm-font:        'Montserrat', sans-serif;
}

/* ============================================================
   AUTH BUTTON  —  LOGIN / PANEL
   No box/border. Hover = gold text only. Matches nav style.
   ============================================================ */
.cpm-btn {
    display: inline-block;
    font-family: var(--cpm-font);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    background: transparent;
    padding: 4px 0;
    white-space: nowrap;
    line-height: 1;
    cursor: pointer;
    transition: color .2s ease;
    color: inherit;
}

.cpm-btn--login { color: var(--cpm-white); }
.cpm-btn--panel { color: var(--cpm-white); }

.cpm-btn--login:hover,
.cpm-btn--login:focus,
.cpm-btn--panel:hover,
.cpm-btn--panel:focus {
    color: var(--cpm-gold);
    text-decoration: none;
}

/* LOG OUT — small muted link */
.cpm-btn--logout {
    font-family: var(--cpm-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cpm-text-muted);
    text-decoration: none;
    margin-left: auto;
    flex-shrink: 0;
    transition: color .2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.cpm-btn--logout:hover {
    color: var(--cpm-error-line);
    text-decoration: none;
}

/* SUBMIT — gold outline button used inside forms */
.cpm-btn--submit {
    font-family: var(--cpm-font);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    border: 1px solid var(--cpm-gold);
    background: transparent;
    color: var(--cpm-dark);
    padding: 10px 28px;
    cursor: pointer;
    transition: background .2s, color .2s;
    text-decoration: none;
    display: inline-block;
}
.cpm-btn--submit:hover {
    background: var(--cpm-gold);
    color: var(--cpm-white);
    text-decoration: none;
}

/* Full-width variant used in the modal */
.cpm-btn--full {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    display: block;
    padding: 12px 28px;
}

/* ============================================================
   PANEL WRAPPER
   ============================================================ */
.cpm-panel-wrap {
    max-width: 1020px;
    margin: 0 auto;
    padding: 8px 24px 64px;
    font-family: var(--cpm-font);
    color: var(--cpm-text);
}

/* ============================================================
   PANEL HEADER STRIP
   ============================================================ */
.cpm-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 28px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--cpm-border);
    border-left: 3px solid var(--cpm-gold);
    background: var(--cpm-white);
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}

.cpm-panel-greeting h2 {
    margin: 0 0 3px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--cpm-dark);
    letter-spacing: .01em;
    font-family: var(--cpm-font);
}

.cpm-panel-role {
    margin: 0;
    font-size: .68rem;
    font-weight: 600;
    color: var(--cpm-gold);
    text-transform: uppercase;
    letter-spacing: .14em;
}

/* ============================================================
   CUSTOMER PANEL BODY  —  two columns
   ============================================================ */
.cpm-panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ============================================================
   SHARED CARD / SECTION STYLES
   ============================================================ */
.cpm-card,
.cpm-change-password,
.cpm-admin-form-card {
    background: var(--cpm-white);
    border: 1px solid var(--cpm-border);
    box-shadow: 0 1px 8px rgba(0,0,0,.04);
    padding: 24px 26px;
    position: relative;
}

/* Gold top accent line on each card */
.cpm-card::before,
.cpm-change-password::before,
.cpm-admin-form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--cpm-gold);
}

.cpm-card h3,
.cpm-change-password h3,
.cpm-admin-form-card h3 {
    margin: 0 0 18px;
    font-family: var(--cpm-font);
    font-size: .68rem;
    font-weight: 700;
    color: var(--cpm-gold);
    text-transform: uppercase;
    letter-spacing: .15em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cpm-border);
}

/* ============================================================
   ACCOUNT DETAILS LIST
   ============================================================ */
.cpm-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cpm-card ul li {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    font-size: .875rem;
    font-weight: 400;
    border-bottom: 1px solid var(--cpm-border);
    color: var(--cpm-text);
    line-height: 1.4;
}

.cpm-card ul li:last-child {
    border-bottom: none;
}

.cpm-card ul li span {
    font-weight: 600;
    color: var(--cpm-text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    min-width: 72px;
    flex-shrink: 0;
    padding-top: 2px;
}

/* ============================================================
   CHANGE PASSWORD FORM
   ============================================================ */
.cpm-pw-form label {
    display: block;
    margin-bottom: 14px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--cpm-text-muted);
    text-transform: uppercase;
    letter-spacing: .09em;
}

.cpm-pw-form input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 12px;
    background: var(--cpm-bg);
    border: 1px solid var(--cpm-border);
    border-radius: 2px;
    font-family: var(--cpm-font);
    font-size: .875rem;
    font-weight: 400;
    color: var(--cpm-dark);
    box-sizing: border-box;
    transition: border-color .15s;
}

.cpm-pw-form input[type="password"]:focus {
    outline: none;
    border-color: var(--cpm-gold);
    box-shadow: 0 0 0 2px var(--cpm-gold-dim);
}

/* ============================================================
   ADMIN REGISTRATION FORM (inside /panel, admin view)
   ============================================================ */
.cpm-admin-form-card {
    /* Full width — admin sees only this card */
    width: 100%;
}

.cpm-form-section-label {
    font-size: .68rem;
    font-weight: 700;
    color: var(--cpm-gold);
    text-transform: uppercase;
    letter-spacing: .15em;
    padding: 18px 0 10px;
    border-bottom: 1px solid var(--cpm-border);
    margin-bottom: 16px;
}

.cpm-form-section-label:first-of-type {
    padding-top: 4px;
}

.cpm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

.cpm-form-group {
    display: flex;
    flex-direction: column;
}

.cpm-form-group label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--cpm-text-muted);
    text-transform: uppercase;
    letter-spacing: .09em;
    margin-bottom: 6px;
}

.cpm-form-group label .req {
    color: var(--cpm-error-line);
    margin-left: 2px;
}

.cpm-hint {
    font-weight: 400;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    font-size: .68rem;
    color: var(--cpm-text-muted);
    margin-left: 4px;
    opacity: .7;
}

.cpm-form-group input[type="text"],
.cpm-form-group input[type="email"],
.cpm-form-group input[type="tel"] {
    padding: 9px 12px;
    background: var(--cpm-bg);
    border: 1px solid var(--cpm-border);
    border-radius: 2px;
    font-family: var(--cpm-font);
    font-size: .875rem;
    font-weight: 400;
    color: var(--cpm-dark);
    box-sizing: border-box;
    transition: border-color .15s;
    width: 100%;
}

.cpm-form-group input::placeholder {
    color: #b0b4bc;
}

.cpm-form-group input:focus {
    outline: none;
    border-color: var(--cpm-gold);
    box-shadow: 0 0 0 2px var(--cpm-gold-dim);
}

.cpm-form-actions {
    padding-top: 20px;
    border-top: 1px solid var(--cpm-border);
    margin-top: 10px;
}

/* Internal section (hidden from customer) */
.cpm-form-section-label--internal {
    color: var(--cpm-text-muted);
    border-bottom-color: #d1d5db;
    border-top: 2px dashed #d1d5db;
    margin-top: 24px;
    padding-top: 18px;
}

.cpm-internal-badge {
    display: inline-block;
    background: #e5e7eb;
    color: #6b7280;
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.cpm-form-group input[type="date"],
.cpm-form-group select {
    padding: 9px 12px;
    background: var(--cpm-bg);
    border: 1px solid var(--cpm-border);
    border-radius: 2px;
    font-family: var(--cpm-font);
    font-size: .875rem;
    font-weight: 400;
    color: var(--cpm-dark);
    box-sizing: border-box;
    transition: border-color .15s;
    width: 100%;
}

.cpm-form-group select:focus,
.cpm-form-group input[type="date"]:focus {
    outline: none;
    border-color: var(--cpm-gold);
    box-shadow: 0 0 0 2px var(--cpm-gold-dim);
}

/* ============================================================
   NOTICES
   ============================================================ */
.cpm-notice {
    padding: 12px 16px;
    font-size: .875rem;
    font-family: var(--cpm-font);
    margin-bottom: 20px;
    line-height: 1.65;
    border-radius: 2px;
}

.cpm-notice code {
    background: rgba(184,150,62,.1);
    color: #7a5c10;
    padding: 1px 7px;
    font-size: .9em;
    letter-spacing: .04em;
    border-radius: 2px;
}

.cpm-error {
    background: var(--cpm-error-bg);
    border-left: 3px solid var(--cpm-error-line);
    color: var(--cpm-error-text);
}

.cpm-success {
    background: rgba(184,150,62,.07);
    border-left: 3px solid var(--cpm-gold);
    color: #5a3f00;
}

/* ============================================================
   FIRST-LOGIN MODAL
   Full-screen overlay. Cannot be dismissed — forces password
   change before the user can access the panel.
   ============================================================ */

/* Overlay: covers the entire viewport, sits above everything
   including Elementor's header */
.cpm-modal-overlay {
    position: fixed;
    inset: 0;                          /* top/right/bottom/left: 0 */
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    /* Dark navy tint matching the site's dark background color */
    background: rgba(13, 17, 23, 0.82);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Modal card */
.cpm-modal {
    background: var(--cpm-white);
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    /* Gold top bar — same pattern as .cpm-card::before
       but implemented as border-top so no ::before needed */
    border-top: 3px solid var(--cpm-gold);
    animation: cpm-modal-in .22s ease;
}

@keyframes cpm-modal-in {
    from { opacity: 0; transform: translateY(-14px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)     scale(1);   }
}

/* Modal header */
.cpm-modal-header {
    padding: 28px 30px 20px;
    border-bottom: 1px solid var(--cpm-border);
}

.cpm-modal-header h2 {
    margin: 0 0 6px;
    font-family: var(--cpm-font);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cpm-dark);
    letter-spacing: .01em;
}

.cpm-modal-subtitle {
    margin: 0;
    font-family: var(--cpm-font);
    font-size: .8rem;
    font-weight: 400;
    color: var(--cpm-text-muted);
    line-height: 1.5;
}

/* Error notice inside the modal */
.cpm-modal-notice {
    margin: 16px 30px 0;
}

/* Modal form body */
.cpm-modal-form {
    padding: 20px 30px 0;
}

/* Modal footer */
.cpm-modal-footer {
    padding: 20px 30px 28px;
}

.cpm-modal-hint {
    margin: 12px 0 0;
    font-family: var(--cpm-font);
    font-size: .7rem;
    font-weight: 400;
    color: var(--cpm-text-muted);
    text-align: center;
    line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 740px) {
    .cpm-panel-body {
        grid-template-columns: 1fr;
    }
    .cpm-form-row {
        grid-template-columns: 1fr;
    }
    .cpm-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .cpm-btn--logout {
        margin-left: 0;
    }
    .cpm-modal-header,
    .cpm-modal-form,
    .cpm-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    .cpm-modal-notice {
        margin-left: 20px;
        margin-right: 20px;
    }
}
