/* ============================================================
   SHE Leads Tools — Brand CSS
   Palette mirrors sheleadsgroup.com (rose/plum + gold accents)
   ============================================================ */

:root {
    --she-primary:       #85215F;   /* deep rose / plum */
    --she-primary-dark:  #631648;
    --she-primary-light: #A82E7A;
    --she-gold:          #C8963E;
    --she-gold-light:    #E8B660;
    --she-white:         #FFFFFF;
    --she-surface:       #FBF7F9;   /* very light pink-tinted white */
    --she-text:          #2D2D2D;
    --she-text-muted:    #6B6B6B;
    --she-border:        #E5D8E0;
    --she-error:         #C0392B;
    --she-success:       #27AE60;

    --font-heading: 'Montserrat', sans-serif;
    --font-body:    'Lato', sans-serif;
    --radius:       6px;
    --shadow:       0 2px 8px rgba(133,33,95,0.10);
    --shadow-lg:    0 4px 20px rgba(133,33,95,0.15);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--she-text);
    background: var(--she-surface);
    line-height: 1.6;
}

a { color: var(--she-primary); text-decoration: none; }
a:hover { color: var(--she-primary-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--she-primary);
    line-height: 1.25;
}

/* ---- Layout ---- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---- Header ---- */
.site-header {
    background: var(--she-white);
    border-bottom: 3px solid var(--she-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 1rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
}

.logo-tag {
    background: var(--she-primary);
    color: var(--she-white);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    align-self: flex-end;
    margin-bottom: 4px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--she-primary);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s;
}

.nav-link:hover, .nav-link.active {
    border-bottom-color: var(--she-gold);
    text-decoration: none;
    color: var(--she-primary-dark);
}

.nav-link-dim { color: var(--she-text-muted); font-weight: 400; }
.nav-sep      { color: var(--she-border); }
.nav-user     { font-size: 0.8rem; color: var(--she-text-muted); }

/* ---- Main / Footer ---- */
.site-main {
    padding: 2.5rem 0 4rem;
    min-height: calc(100vh - 130px);
}

.site-footer {
    background: var(--she-primary-dark);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
}

/* ---- Page heading ---- */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--she-border);
}

.page-header h1 { font-size: 1.75rem; }
.page-header p  { color: var(--she-text-muted); margin-top: 0.4rem; }

/* ---- Cards ---- */
.card {
    background: var(--she-white);
    border: 1px solid var(--she-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.card + .card { margin-top: 1.25rem; }

.card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--she-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.1em;
    background: var(--she-gold);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--she-primary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--she-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--she-text);
    background: var(--she-white);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--she-primary);
    box-shadow: 0 0 0 3px rgba(133,33,95,0.12);
}

textarea { resize: vertical; min-height: 160px; }

/* ---- Search row ---- */
.search-row {
    display: flex;
    gap: 0.5rem;
}

.search-row input { flex: 1; }

/* ---- Selected profile badge ---- */
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(133,33,95,0.08);
    border: 1px solid var(--she-primary);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.875rem;
    color: var(--she-primary);
    font-weight: 600;
    margin-top: 0.5rem;
}

.profile-badge .badge-clear {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--she-text-muted);
}

.profile-badge .badge-clear:hover { color: var(--she-error); }

/* ---- Search results dropdown ---- */
.search-results {
    border: 1px solid var(--she-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--she-white);
    box-shadow: var(--shadow);
    max-height: 240px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--she-border);
    font-size: 0.9rem;
    transition: background 0.1s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(133,33,95,0.07); }

.result-name { font-weight: 600; color: var(--she-text); }
.result-meta { font-size: 0.78rem; color: var(--she-text-muted); }

.result-type-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.result-type-badge.member { background: #E8F5E9; color: #2E7D32; }
.result-type-badge.lead   { background: #FFF3E0; color: #E65100; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0.6rem 1.4rem;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--she-primary);
    color: var(--she-white);
    box-shadow: 0 2px 6px rgba(133,33,95,0.25);
}

.btn-primary:hover {
    background: var(--she-primary-dark);
    color: var(--she-white);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(133,33,95,0.3);
}

.btn-gold {
    background: var(--she-gold);
    color: var(--she-white);
    box-shadow: 0 2px 6px rgba(200,150,62,0.3);
}

.btn-gold:hover {
    background: var(--she-gold-light);
    color: var(--she-white);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--she-primary);
    border: 2px solid var(--she-primary);
}

.btn-outline:hover {
    background: var(--she-primary);
    color: var(--she-white);
    text-decoration: none;
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.78rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 0.95rem; }

.btn[disabled], .btn.htmx-request {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- Action row ---- */
.action-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--she-border);
}

/* ---- Alerts ---- */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid;
}

.alert-error   { background: #FDF0F0; border-color: var(--she-error);   color: var(--she-error); }
.alert-success { background: #F0FDF4; border-color: var(--she-success);  color: #166534; }
.alert-info    { background: #EEF2FF; border-color: #6366F1;             color: #4338CA; }

/* ---- Login page ---- */
.login-wrap {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--she-white);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-box-header {
    background: var(--she-primary);
    padding: 2rem 2rem 1.75rem;
    text-align: center;
}

.login-box-header img  { height: 60px; width: auto; }
.login-box-header h2   { color: var(--she-white); font-size: 1.1rem; margin-top: 0.75rem; font-weight: 500; }

.login-box-body  { padding: 2rem; }
.login-box-body .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }

/* ---- Table ---- */
.she-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.she-table th {
    text-align: left;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--she-primary);
    padding: 0.6rem 0.85rem;
    border-bottom: 2px solid var(--she-primary);
    white-space: nowrap;
}

.she-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--she-border);
    vertical-align: top;
}

.she-table tr:hover td { background: rgba(133,33,95,0.04); }

/* ---- Status badges ---- */
.status-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.pending  { background: #FFF8E1; color: #B8860B; }
.status-badge.approved { background: #E8F5E9; color: #2E7D32; }
.status-badge.rejected { background: #FFEBEE; color: #C62828; }

/* ---- HTMX loading indicator ---- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }

.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Draft preview ---- */
.draft-subject {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--she-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--she-border);
}

/* ---- Utilities ---- */
.text-muted { color: var(--she-text-muted); }
.text-sm    { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ---- Slot toggle (Member / Lead / Non-CRM) ---- */
.slot-toggle {
    display: inline-flex;
    border: 1.5px solid var(--she-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.slot-toggle label {
    display: flex;
    align-items: center;
    padding: 0.4rem 1rem;
    cursor: pointer;
    background: var(--she-white);
    color: var(--she-text-muted);
    border-right: 1px solid var(--she-border);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.slot-toggle label:last-child { border-right: none; }

.slot-toggle label.active {
    background: var(--she-primary);
    color: var(--she-white);
}

.slot-toggle label:hover:not(.active) {
    background: rgba(133,33,95,0.06);
}

.slot-toggle input[type="radio"] { display: none; }

/* ---- Form grid layouts ---- */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ---- Required field marker ---- */
.req { color: var(--she-error); margin-left: 2px; }

/* ---- Profile detail sub-section ---- */
.profile-details {
    border-top: 1px dashed var(--she-border);
    padding-top: 1rem;
    margin-top: 0.75rem;
}

.profile-details .form-group { margin-bottom: 0.75rem; }

/* ---- Secondary button ---- */
.btn-secondary {
    background: var(--she-white);
    color: var(--she-primary);
    border: 2px solid var(--she-primary);
}

.btn-secondary:hover {
    background: var(--she-primary);
    color: var(--she-white);
    text-decoration: none;
}

/* ---- URL input (same style as text) ---- */
input[type="url"] {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--she-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--she-text);
    background: var(--she-white);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

input[type="url"]:focus {
    border-color: var(--she-primary);
    box-shadow: 0 0 0 3px rgba(133,33,95,0.12);
}

/* ---- Intro layout: two-column people cards ---- */
.intro-people {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .intro-people { grid-template-columns: 1fr; }
    .form-row-2   { grid-template-columns: 1fr; }
    .form-row-3   { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; align-items: flex-start; }
    .logo-img { height: 42px; }
    .action-row { flex-direction: column; }
    .action-row .btn { width: 100%; justify-content: center; }
    .she-table th, .she-table td { padding: 0.5rem; font-size: 0.82rem; }
}
