/* BunkMail Public Styles — all rules scoped to .bm-app */

/* ── Full-width template wrapper ────────────────────────────── */
#bm-fullwidth-content { width: 100%; }

/* ── Layout ─────────────────────────────────────────────────── */
.bm-app { max-width: 680px; margin: 0 auto; padding: 0 16px; }

.bm-app--nav {
    display: flex !important;
    align-items: flex-start !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ── Sidebar nav ─────────────────────────────────────────────── */
.bm-app--nav .bm-nav {
    background: #2c3e50 !important;
    color: #ecf0f1 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    min-height: calc(100vh - 60px) !important;
    padding: 20px 0 0 !important;
    width: 220px !important;
    box-sizing: border-box !important;
}

.bm-app--nav .bm-nav-brand {
    color: #3498db !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    padding: 0 20px 20px !important;
    letter-spacing: -0.3px !important;
    display: block !important;
}

/*
 * Themes with collapsible mobile menus often style generic `nav ul`
 * (position: absolute, max-height, transforms). These resets keep the
 * BunkMail nav list in normal document flow at every screen size.
 */
.bm-app--nav .bm-nav ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    z-index: auto !important;
}

.bm-app--nav .bm-nav-links { flex: 1; }

.bm-app--nav .bm-nav-links li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.bm-app--nav .bm-nav-links li::before { display: none !important; }

.bm-app--nav .bm-nav-links li a {
    align-items: center;
    color: #bdc3c7 !important;
    display: flex !important;
    font-size: 14px;
    gap: 10px;
    padding: 11px 20px;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
}
.bm-app--nav .bm-nav-links li a:hover { background: #34495e; color: #fff !important; }
.bm-app--nav .bm-nav-links li.bm-nav-active a { background: #1a252f; color: #3498db !important; font-weight: 600; }

.bm-app--nav .bm-nav .dashicons { font-size: 16px; height: 16px; line-height: 1; width: 16px; }

.bm-app--nav .bm-nav-credits {
    align-items: center;
    background: #1a252f !important;
    border-radius: 6px;
    color: #f39c12 !important;
    display: flex !important;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    list-style: none !important;
    margin: 10px 12px 12px !important;
    padding: 10px 14px 10px 20px !important;
    border-top: none;
}
.bm-app--nav .bm-nav-credits .dashicons { color: #f39c12 !important; font-size: 15px !important; }

/* ── Main content area (when nav present) ───────────────────── */
.bm-main {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 30px 32px !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* ── Login message banner ────────────────────────────────────── */
.bm-login-message {
    background: #ebf5fb;
    border-left: 4px solid #3498db;
    border-radius: 3px;
    margin-bottom: 20px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
}

/* ── FAQ ─────────────────────────────────────────────────────── */
.bm-faq { margin: 0; }
.bm-faq dt {
    border-bottom: 1px dashed #dee2e6;
    color: #1a252f;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 0 4px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.bm-faq dd {
    border-bottom: 1px dashed #dee2e6;
    color: #444;
    font-size: 14px;
    margin: 0;
    padding: 8px 0 14px 0;
    line-height: 1.6;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.bm-faq-label {
    display: inline-block;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.6;
    text-transform: uppercase;
}
.bm-faq-label--q { background: #ebf5fb; color: #3498db; }
.bm-faq-label--a { background: #eafaf1; color: #27ae60; }

/* Notices */
.bm-notice { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.bm-notice ul { margin: 0; padding-left: 20px; }
.bm-notice--error   { background: #fdf2f2; border-left: 4px solid #e74c3c; color: #c0392b; }
.bm-notice--success { background: #f0fdf4; border-left: 4px solid #2ecc71; color: #1a7a3f; }

/* Forms */
.bm-form { max-width: 460px; }
.bm-field { margin-bottom: 16px; }
.bm-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.bm-field input[type="text"],
.bm-field input[type="email"],
.bm-field input[type="password"],
.bm-field input[type="tel"],
.bm-field select,
.bm-field textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; box-sizing: border-box; }
.bm-field textarea { resize: vertical; min-height: 200px; }
.bm-field-row { display: flex; gap: 12px; }
.bm-field-row .bm-field { flex: 1; }
.bm-field-row .bm-field--state { flex: 0 0 100px; }
.bm-field-row .bm-field--zip   { flex: 0 0 120px; }
.bm-hint { font-size: 12px; color: #888; margin-top: 4px; }

/* Buttons */
.bm-btn { display: inline-block; padding: 11px 22px; border-radius: 4px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: none; }
.bm-btn--primary   { background: #2c3e50; color: #fff; }
.bm-btn--primary:hover { background: #1a252f; color: #fff; }
.bm-btn--secondary { background: #ecf0f1; color: #2c3e50; }
.bm-btn--danger    { background: #e74c3c; color: #fff; }
.bm-btn:disabled   { cursor: not-allowed; opacity: 0.6; }

/* Nav / links */
.bm-alt-link { font-size: 14px; color: #555; margin-top: 12px; }

/* Dashboard cards */
.bm-dashboard-cards { display: flex; gap: 20px; flex-wrap: wrap; margin: 20px 0; }
.bm-card { flex: 1; min-width: 200px; background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 20px; }
.bm-card h3 { margin-top: 0; font-size: 14px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.bm-credit-balance { font-size: 48px; font-weight: 700; color: #2c3e50; line-height: 1; }
.bm-camper-list { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }
.bm-quick-links { margin-top: 20px; display: flex; gap: 16px; flex-wrap: wrap; }
.bm-quick-links a { font-size: 14px; color: #2c3e50; }

/* Compose */
.bm-compose-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.bm-char-counter { font-size: 12px; font-weight: normal; color: #888; float: right; }
.bm-compose-footer { margin-top: 8px; display: flex; align-items: center; gap: 16px; }

/* Credits badge (compose header) */
.bm-credits-badge { display: flex; align-items: center; gap: 10px; }
.bm-credits-badge__count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a252f;
    color: #f39c12;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
}
.bm-credits-badge__count .dashicons { font-size: 15px; height: 15px; width: 15px; line-height: 1; color: #f39c12; }
.bm-credits-badge__count strong { color: #fff; font-size: 16px; }
.bm-credits-badge__buy {
    display: inline-block;
    background: #2980b9;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: background 0.15s;
}
.bm-credits-badge__buy:hover { background: #1f6391; color: #fff !important; }

/* Camper checkboxes */
.bm-camper-checkboxes { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 4px; }
.bm-camper-check-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: normal; cursor: pointer; }
.bm-camper-check-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #2c3e50; }

/* Credit packages */
.bm-packages { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.bm-package { cursor: pointer; border: 2px solid #dee2e6; border-radius: 6px; transition: border-color 0.15s, background 0.15s; user-select: none; }
.bm-package:hover { border-color: #adb5bd; background: #fafafa; }
.bm-package--selected { border-color: #2c3e50 !important; background: #f0f4f8 !important; }
.bm-package-label { display: block; padding: 14px 20px; text-align: center; min-width: 100px; pointer-events: none; }
.bm-package-label strong { display: block; font-size: 20px; }
.bm-package-price { font-size: 14px; color: #666; }

/* Section label (credits page) */
.bm-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #888; border-bottom: 1px solid #dee2e6; padding-bottom: 6px; margin: 24px 0 16px; }

.bm-purchase-summary { background: #eafaf1; border-left: 4px solid #27ae60; border-radius: 3px; padding: 10px 14px; font-size: 14px; color: #1e8449; margin-bottom: 8px; }
.bm-purchase-summary strong { color: #1a5c32; }

/* Collect.js hosted fields */
.bm-collect-field { height: 44px; box-sizing: border-box; padding: 0; }
.bm-collect-field iframe { border: none !important; display: block; height: 100% !important; width: 100% !important; }

/* Table */
.bm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.bm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bm-table th { background: #f1f3f5; padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid #dee2e6; }
.bm-table td { padding: 10px 12px; border-bottom: 1px solid #dee2e6; vertical-align: top; }
.bm-table tr:last-child td { border-bottom: none; }
.bm-message-cell { max-width: 400px; }
.bm-message-preview { color: #444; }
.bm-message-full { white-space: pre-wrap; color: #444; margin-bottom: 6px; }
.bm-message-toggle {
    background: none;
    border: none;
    color: #2980b9;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 0;
    text-decoration: underline;
}

/* Pagination */
.bm-pagination { margin-top: 16px; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.bm-pagination a { color: #2c3e50; }
.bm-page-info { color: #888; }

/* ── Auth pages (login / register / forgot / reset) ─────────── */
.bm-auth-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 16px 60px;
    box-sizing: border-box;
}


.bm-auth-card {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    box-shadow: 0 4px 28px rgba(0, 0, 0, .09);
    box-sizing: border-box;
    max-width: 460px;
    padding: 36px 40px 32px;
    width: 100%;
}

.bm-auth-card h2 {
    color: #1a252f;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.bm-auth-card .bm-auth-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 24px;
}

.bm-auth-card .bm-form {
    max-width: none;
}

.bm-auth-card .bm-field input[type="text"],
.bm-auth-card .bm-field input[type="email"],
.bm-auth-card .bm-field input[type="password"],
.bm-auth-card .bm-field input[type="tel"] {
    border-color: #d1d5db;
    border-radius: 6px;
    padding: 11px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bm-auth-card .bm-field input:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(41, 128, 185, .15);
    outline: none;
}

.bm-auth-card .bm-btn--primary {
    background: #2980b9;
    border-radius: 6px;
    display: block;
    font-size: 16px;
    margin-top: 6px;
    padding: 12px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.bm-auth-card .bm-btn--primary:hover {
    background: #1f6391;
}

.bm-auth-card .bm-alt-link {
    margin-top: 22px;
    text-align: center;
}

.bm-auth-card .bm-login-message {
    margin-bottom: 20px;
}

.bm-auth-card .bm-notice {
    margin-bottom: 16px;
}

/* Password strength meter */
.bm-pw-strength {
    background: #e5e7eb;
    border-radius: 3px;
    height: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.bm-pw-strength__bar {
    border-radius: 3px;
    height: 100%;
    transition: width 0.25s ease, background-color 0.25s ease;
    width: 0;
}

.bm-pw-strength__label {
    color: #6b7280;
    font-size: 11px;
    margin-top: 4px;
}

.bm-pw-strength--weak   .bm-pw-strength__bar { background: #ef4444; width: 33%; }
.bm-pw-strength--fair   .bm-pw-strength__bar { background: #f59e0b; width: 66%; }
.bm-pw-strength--strong .bm-pw-strength__bar { background: #22c55e; width: 100%; }
.bm-pw-strength--weak   .bm-pw-strength__label { color: #ef4444; }
.bm-pw-strength--fair   .bm-pw-strength__label { color: #f59e0b; }
.bm-pw-strength--strong .bm-pw-strength__label { color: #22c55e; }

/* Password input wrapper for show/hide toggle */
.bm-pw-wrap {
    position: relative;
}

.bm-pw-wrap input {
    padding-right: 46px !important;
}

.bm-pw-toggle {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    height: 100%;
    line-height: 1;
    padding: 0 12px;
    position: absolute;
    right: 0;
    top: 0;
    transition: color 0.15s;
}

.bm-pw-toggle:hover { color: #374151; }

@media (max-width: 520px) {
    .bm-auth-wrap { padding: 24px 12px 40px; }
    .bm-auth-card { border-radius: 8px; padding: 28px 20px 24px; }
}

/* ── Responsive ──────────────────────────────────────────────── */

/* Tablet: narrower sidebar so content keeps breathing room */
@media (max-width: 900px) {
    .bm-app--nav .bm-nav { width: 180px !important; }
    .bm-app--nav .bm-nav-brand { font-size: 19px !important; padding: 0 16px 16px !important; }
    .bm-app--nav .bm-nav-links li a { padding: 11px 16px; }
    .bm-main { padding: 24px 20px !important; }
}

/* Mobile: sidebar becomes a compact top bar with wrapping pill links */
@media (max-width: 700px) {
    .bm-app--nav { flex-direction: column !important; }

    .bm-app--nav .bm-nav {
        position: relative !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        padding: 14px 14px 14px !important;
        width: 100% !important;
    }

    .bm-app--nav .bm-nav-brand {
        font-size: 18px !important;
        padding: 0 2px 12px !important;
    }

    .bm-app--nav .bm-nav ul.bm-nav-links {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .bm-app--nav .bm-nav ul.bm-nav-links > li {
        position: static !important;
        display: block !important;
        float: none !important;
        flex: 0 0 auto;
        margin: 0 !important;
        width: auto !important;
    }

    .bm-app--nav .bm-nav ul.bm-nav-links > li > a {
        background: #34495e !important;
        border-radius: 16px !important;
        display: inline-flex !important;
        font-size: 13px !important;
        gap: 6px !important;
        line-height: 1.3 !important;
        padding: 8px 13px !important;
        white-space: nowrap !important;
        width: auto !important;
    }
    .bm-app--nav .bm-nav ul.bm-nav-links > li.bm-nav-active > a {
        background: #1a252f !important;
    }

    .bm-app--nav .bm-nav ul.bm-nav-links > li.bm-nav-credits {
        display: flex !important;
        align-items: center !important;
        flex-basis: 100% !important;
        justify-content: center !important;
        margin: 8px 0 0 !important;
        padding: 9px 12px !important;
    }

    .bm-main { padding: 20px 16px !important; }

    /* Stack form rows; State/ZIP go full width like the rest */
    .bm-field-row { flex-direction: column; gap: 0; }
    .bm-field-row .bm-field--state,
    .bm-field-row .bm-field--zip { flex: 0 0 auto; }

    /* 16px inputs prevent iOS Safari from auto-zooming on focus */
    .bm-field input[type="text"],
    .bm-field input[type="email"],
    .bm-field input[type="password"],
    .bm-field input[type="tel"],
    .bm-field select,
    .bm-field textarea { font-size: 16px; }

    .bm-dashboard-cards { flex-direction: column; }
    .bm-credit-balance { font-size: 36px; }

    .bm-compose-header { flex-direction: column; align-items: flex-start; }
    .bm-compose-footer { flex-wrap: wrap; }
    .bm-credits-badge { flex-wrap: wrap; }

    .bm-message-cell { max-width: none; min-width: 200px; }
}

/* Small phones: full-width buttons and two-up credit packages */
@media (max-width: 480px) {
    .bm-btn { display: block; text-align: center; width: 100%; box-sizing: border-box; }
    .bm-btn + .bm-btn,
    .bm-btn + a.bm-btn { margin-top: 8px; margin-left: 0 !important; }

    .bm-packages { gap: 8px; }
    .bm-package { flex: 1 1 calc(50% - 4px); }
    .bm-package-label { min-width: 0; padding: 12px 8px; }

    .bm-credits-badge__count,
    .bm-credits-badge__buy { font-size: 12px; padding: 6px 10px; }
}
