/* TJCMEL Frontend Portal CSS v1.21.6 */
*, *::before, *::after { box-sizing: border-box; }

/* Hide WordPress theme header — portal renders its own */
header.wp-block-template-part,
.wp-block-template-part[class*="header"] { display: none !important; }

.fe-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0 80px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #1d2327;
}

/* ── Merged header bar (brand + nav + logout in one row) ── */
.fe-header {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 16px;
    background: #0073aa;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 48px;
}
.fe-brand {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    padding: 14px 12px 14px 0;
    margin-right: 8px;
    border-right: 1px solid rgba(255,255,255,.25);
    letter-spacing: .3px;
}
.fe-header h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    padding: 0 12px;
    white-space: nowrap;
}
.fe-header-nav {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}
.fe-header-nav::-webkit-scrollbar { display: none; }
.fe-nav-item {
    padding: 14px 14px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    align-self: stretch;
    display: flex;
    align-items: center;
}
.fe-nav-item.active, .fe-nav-item:hover { color: #fff; border-bottom-color: rgba(255,255,255,.8); }
.fe-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding-left: 12px;
    flex-shrink: 0;
}
.fe-logout { color: rgba(255,255,255,.8); font-size: 13px; text-decoration: none; }
.fe-logout:hover { color: #fff; }

/* Legacy .fe-nav — no longer used as separate bar, kept for other portals */
.fe-nav {
    display: flex;
    overflow-x: auto;
    background: #005a87;
    border-bottom: 2px solid #004066;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 48px;
    z-index: 99;
}
.fe-nav::-webkit-scrollbar { display: none; }

/* Role badge */
.fe-role-badge {
    display: inline-block;
    background: #e8f4fd;
    border: 1px solid #bce0f5;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #0a5275;
    margin: 8px 16px;
}

/* Section title */
.fe-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #666;
    padding: 16px 16px 6px;
}

/* Cards grid */
.fe-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 12px 16px;
}
.fe-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, transform .1s;
    cursor: pointer;
}
.fe-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-1px); }
.fe-card-icon { font-size: 32px; margin-bottom: 6px; }
.fe-card-label { font-size: 14px; font-weight: 600; color: #1d2327; }
.fe-card-sub { font-size: 12px; color: #888; margin-top: 2px; }

/* List items */
.fe-list { background: #fff; }
.fe-list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    gap: 8px;
}
.fe-list-item:hover { background: #f9f9f9; }
.fe-list-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.fe-list-main { font-size: 14px; font-weight: 500; }
.fe-list-sub { font-size: 12px; color: #888; margin-top: 2px; }
.fe-list-actions { display: flex; gap: 6px; flex-shrink: 0; }
.fe-chevron { margin-left: auto; color: #aaa; font-size: 20px; }
.fe-empty { padding: 32px 16px; text-align: center; color: #888; font-size: 14px; }

/* Member list */
.fe-member-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    background: #fff;
}
.fe-family-start { border-top: 2px solid #0073aa22; }
.fe-member-photo { width: 44px; height: 58px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.fe-member-initials {
    width: 44px; height: 58px; border-radius: 6px; background: #e8f4fd;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #0a5275; flex-shrink: 0;
}
.fe-member-info { flex: 1; min-width: 0; }
.fe-member-name { font-size: 14px; font-weight: 500; }
.fe-chinese { font-size: 16px; letter-spacing: 1px; }
.fe-member-sub { font-size: 12px; color: #888; margin-top: 2px; }
.fe-member-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Buttons */
.fe-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    text-align: center;
}
.fe-btn-primary { background: #0073aa; color: #fff; }
.fe-btn-primary:hover { background: #005d8c; color: #fff; }
.fe-btn-outline { background: transparent; color: #0073aa; border: 1px solid #0073aa; }
.fe-btn-outline:hover { background: #f0f7fd; }
.fe-btn-block { display: block; width: 100%; }
.fe-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

/* Notices */
.fe-notice {
    margin: 8px 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}
.fe-notice-warn { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.fe-notice-ok   { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.fe-notice-err  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Status pages */
.fe-status-wrap {
    max-width: 420px;
    margin: 48px auto;
    text-align: center;
    padding: 32px 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.fe-status-icon { font-size: 64px; margin-bottom: 16px; }
.fe-status-wrap h2 { font-size: 22px; margin-bottom: 12px; }
.fe-status-wrap p { color: #555; font-size: 15px; line-height: 1.6; margin-bottom: 16px; }

/* Registration form */
.tjcmel-reg-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-align: center;
}
.tjcmel-reg-form { text-align: left; }
.tjcmel-reg-form h2 { text-align: center; margin-bottom: 4px; font-size: 22px; }
.tjcmel-hint { text-align: center; color: #666; font-size: 13px; margin-bottom: 16px; }
.tjcmel-reg-form label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.tjcmel-reg-form input[type=text],
.tjcmel-reg-form input[type=email],
.tjcmel-reg-form input[type=password] {
    display: block; width: 100%; padding: 10px 12px; margin-top: 4px;
    border: 1px solid #ccc; border-radius: 8px; font-size: 15px;
    font-weight: 400;
}
.tjcmel-wg-fieldset {
    border: 1px solid #ddd; border-radius: 10px; padding: 14px 16px; margin: 16px 0;
}
.tjcmel-wg-fieldset legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.tjcmel-wg-label {
    display: flex !important; align-items: center; gap: 10px;
    margin: 8px 0 !important; font-weight: 400 !important; cursor: pointer;
}
.tjcmel-wg-label input[type=checkbox] { width: 20px; height: 20px; accent-color: #0073aa; flex-shrink: 0; }
.tjcmel-btn { background: #0073aa; color: #fff; border: none; padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.tjcmel-btn:hover { background: #005d8c; }
.tjcmel-btn-block { display: block; width: 100%; text-align: center; }
.tjcmel-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.tjcmel-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.tjcmel-status-icon { font-size: 56px; margin-bottom: 12px; }

/* Roll call overrides for frontend */
.fe-wrap .tjcmel-wrap { max-width: none; }
.fe-wrap .wrap.tjcmel-wrap { padding: 0 16px; }
.fe-wrap h1 { font-size: 18px; }

/* Mobile */
@media (max-width: 480px) {
    .fe-cards { grid-template-columns: 1fr 1fr; }
    .fe-member-actions { flex-direction: column; gap: 4px; }
}
