/*
 * OurHOAPage Core — Front-end stylesheet v1.0.0
 * Colors use CSS custom properties set per-HOA by HOASettings::output_css_vars()
 */

:root {
    --hoa-primary:    #1B3A5C;
    --hoa-accent:     #4A9B6F;
    --hoa-bg:         #F8F7F4;
    --hoa-surface:    #ffffff;
    --hoa-border:     #E2E0DC;
    --hoa-text:       #1A1A1A;
    --hoa-text-muted: #6B7280;
    --hoa-radius:     10px;
    --hoa-radius-sm:  6px;
    --hoa-shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --hoa-shadow-md:  0 4px 12px rgba(0,0,0,.10);
    --hoa-transition: 150ms ease;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
.ourhoa-dashboard,.ourhoa-profile,.ourhoa-directory,
.ourhoa-doc-library,.ourhoa-login-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--hoa-text);
    line-height: 1.6;
    box-sizing: border-box;
}
*,*::before,*::after { box-sizing: inherit; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ourhoa-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: var(--hoa-radius-sm);
    border: 1.5px solid transparent; font-size: 14px; font-weight: 500;
    cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1;
    transition: background var(--hoa-transition), border-color var(--hoa-transition), opacity var(--hoa-transition);
}
.ourhoa-btn--primary { background: var(--hoa-primary); color: #fff; border-color: var(--hoa-primary); }
.ourhoa-btn--primary:hover { opacity:.88; color:#fff; }
.ourhoa-btn--ghost   { background: transparent; color: var(--hoa-primary); border-color: var(--hoa-primary); }
.ourhoa-btn--ghost:hover { background: rgba(27,58,92,.06); }
.ourhoa-btn--sm   { padding: 7px 14px; font-size: 13px; }
.ourhoa-btn--full { width: 100%; justify-content: center; }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.ourhoa-input {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--hoa-border); border-radius: var(--hoa-radius-sm);
    font-size: 15px; background: var(--hoa-surface); color: var(--hoa-text); outline: none;
    transition: border-color var(--hoa-transition), box-shadow var(--hoa-transition);
}
.ourhoa-input:focus { border-color: var(--hoa-primary); box-shadow: 0 0 0 3px rgba(27,58,92,.12); }

.ourhoa-label { display: block; font-size: 13px; font-weight: 500; color: var(--hoa-text-muted); margin-bottom: 5px; }
.ourhoa-label__required { color: #DC2626; margin-left: 2px; }
.ourhoa-form-group { display: flex; flex-direction: column; gap: 4px; }
.ourhoa-form-hint  { font-size: 12px; color: var(--hoa-text-muted); margin: 4px 0 0; }
.ourhoa-form-row   { display: flex; gap: 12px; align-items: flex-start; }
.ourhoa-form-row--between { justify-content: space-between; align-items: center; }
.ourhoa-form-row--2col > * { flex: 1; }
.ourhoa-form-row--3col > * { flex: 1; }
.ourhoa-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 4px 0; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.ourhoa-alert { padding: 12px 16px; border-radius: var(--hoa-radius-sm); font-size: 14px; margin-bottom: 16px; border-left: 4px solid transparent; }
.ourhoa-alert--error   { background: #FEF2F2; border-color: #DC2626; color: #991B1B; }
.ourhoa-alert--success { background: #F0FDF4; border-color: #16A34A; color: #15803D; }
.ourhoa-notice  { color: var(--hoa-text-muted); font-size: 14px; }
.ourhoa-loading { text-align: center; padding: 40px; color: var(--hoa-text-muted); font-size: 14px; }
.ourhoa-link    { color: var(--hoa-accent); text-decoration: none; }
.ourhoa-link:hover { text-decoration: underline; }

/* ── Login ───────────────────────────────────────────────────────────────── */
.ourhoa-login-wrap {
    display: flex; justify-content: center; align-items: flex-start;
    padding: 40px 16px; min-height: 100vh; background: var(--hoa-bg);
}
.ourhoa-login-card {
    background: var(--hoa-surface); border-radius: var(--hoa-radius);
    box-shadow: var(--hoa-shadow-md); padding: 40px; width: 100%; max-width: 440px;
}
.ourhoa-login-card__logo    { text-align: center; margin-bottom: 24px; }
.ourhoa-login-card__heading { font-size: 22px; font-weight: 600; text-align: center; margin: 0 0 24px; color: var(--hoa-primary); }
.ourhoa-login-form          { display: flex; flex-direction: column; gap: 16px; }
.ourhoa-login-card__footer  { text-align: center; font-size: 13px; color: var(--hoa-text-muted); margin-top: 20px; }
.ourhoa-already-logged-in   { text-align: center; padding: 40px 0; }

/* ── HOA Header ──────────────────────────────────────────────────────────── */
.ourhoa-hoa-header { position: relative; padding: 40px 24px; background: var(--hoa-primary); border-radius: var(--hoa-radius); overflow: hidden; margin-bottom: 24px; }
.ourhoa-hoa-header__inner { display: flex; align-items: center; gap: 20px; position: relative; z-index: 1; }
.ourhoa-hoa-header__logo  { width: 80px; height: 80px; object-fit: contain; border-radius: 12px; background: rgba(255,255,255,.15); padding: 4px; flex-shrink: 0; }
.ourhoa-hoa-header__name  { font-size: 28px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.ourhoa-hoa-header__tagline { color: rgba(255,255,255,.8); margin: 0; font-size: 15px; }

/* ── Quick links ─────────────────────────────────────────────────────────── */
.ourhoa-quick-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.ourhoa-quick-links__item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 8px; background: var(--hoa-surface); border: 1.5px solid var(--hoa-border);
    border-radius: var(--hoa-radius); text-decoration: none; color: var(--hoa-primary);
    font-size: 13px; font-weight: 500;
    transition: box-shadow var(--hoa-transition), border-color var(--hoa-transition);
}
.ourhoa-quick-links__item:hover { border-color: var(--hoa-primary); box-shadow: var(--hoa-shadow); }
.ourhoa-quick-links__icon { font-size: 24px; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.ourhoa-dashboard { max-width: 760px; margin: 0 auto; padding: 0 16px 120px; }
.ourhoa-dashboard__header { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: var(--hoa-radius); margin-bottom: 24px; }
.ourhoa-dashboard__header-text { flex: 1; }
.ourhoa-dashboard__welcome { color: #fff; font-size: 18px; font-weight: 600; margin: 0; }
.ourhoa-dashboard__meta    { color: rgba(255,255,255,.75); font-size: 13px; margin: 2px 0 0; }
.ourhoa-dashboard__logo    { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.15); padding: 3px; }

.ourhoa-dashboard-section { background: var(--hoa-surface); border: 1.5px solid var(--hoa-border); border-radius: var(--hoa-radius); padding: 20px; margin-bottom: 16px; }
.ourhoa-dashboard-section__title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--hoa-primary); margin: 0 0 14px; }
.ourhoa-dashboard-section__more  { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--hoa-accent); text-decoration: none; }
.ourhoa-dashboard-section__more:hover { text-decoration: underline; }

/* ── Activity list ───────────────────────────────────────────────────────── */
.ourhoa-activity-list { list-style: none; margin: 0; padding: 0; }
.ourhoa-activity-list__item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--hoa-border); font-size: 14px; gap: 12px; }
.ourhoa-activity-list__item:last-child { border-bottom: none; }
.ourhoa-activity-list__item a { color: var(--hoa-primary); text-decoration: none; flex: 1; }
.ourhoa-activity-list__item a:hover { text-decoration: underline; }
.ourhoa-activity-list__time { font-size: 12px; color: var(--hoa-text-muted); white-space: nowrap; }

/* ── Event list ──────────────────────────────────────────────────────────── */
.ourhoa-event-list { list-style: none; margin: 0; padding: 0; }
.ourhoa-event-item { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--hoa-border); }
.ourhoa-event-item:last-child { border-bottom: none; }
.ourhoa-event-item__date-block { display: flex; flex-direction: column; align-items: center; background: var(--hoa-primary); color: #fff; border-radius: 6px; padding: 6px 10px; min-width: 44px; flex-shrink: 0; }
.ourhoa-event-item__month { font-size: 10px; font-weight: 600; text-transform: uppercase; }
.ourhoa-event-item__day   { font-size: 20px; font-weight: 700; line-height: 1; }
.ourhoa-event-item__title { color: var(--hoa-primary); text-decoration: none; font-weight: 500; font-size: 14px; }
.ourhoa-event-item__meta  { font-size: 12px; color: var(--hoa-text-muted); margin: 3px 0 0; }

/* ── Document library ────────────────────────────────────────────────────── */
.ourhoa-doc-library { max-width: 760px; margin: 0 auto; padding-bottom: 80px; }
.ourhoa-doc-library__toolbar { margin-bottom: 16px; }
.ourhoa-doc-library__search  { margin-bottom: 20px; max-width: 360px; }
.ourhoa-doc-category { margin-bottom: 8px; }
.ourhoa-doc-category__title  { margin: 0; }
.ourhoa-doc-category__toggle {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 14px 16px; background: var(--hoa-primary); color: #fff;
    border: none; border-radius: var(--hoa-radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
}
.ourhoa-doc-category__count   { background: rgba(255,255,255,.25); border-radius: 100px; padding: 2px 8px; font-size: 12px; }
.ourhoa-doc-category__chevron { margin-left: auto; transition: transform var(--hoa-transition); }
.ourhoa-doc-category__toggle[aria-expanded="false"] .ourhoa-doc-category__chevron { transform: rotate(-90deg); }

.ourhoa-doc-list { list-style: none; margin: 0; padding: 0; }
.ourhoa-doc-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--hoa-surface); border: 1px solid var(--hoa-border); border-top: none; }
.ourhoa-doc-item:last-child { border-radius: 0 0 var(--hoa-radius-sm) var(--hoa-radius-sm); }
.ourhoa-doc-item__icon { width: 40px; height: 40px; background: var(--hoa-primary); color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.ourhoa-doc-item__icon--pdf  { background: #DC2626; }
.ourhoa-doc-item__icon--docx, .ourhoa-doc-item__icon--doc { background: #2563EB; }
.ourhoa-doc-item__body  { flex: 1; min-width: 0; }
.ourhoa-doc-item__title { display: block; font-weight: 500; color: var(--hoa-primary); text-decoration: none; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ourhoa-doc-item__title:hover { text-decoration: underline; }
.ourhoa-doc-item__meta  { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--hoa-text-muted); margin-top: 2px; }
.ourhoa-doc-item__visibility { background: #EEF3F8; color: var(--hoa-primary); padding: 1px 6px; border-radius: 4px; }
.ourhoa-doc-item__actions { display: flex; gap: 8px; }
.ourhoa-doc-item__action { color: var(--hoa-text-muted); padding: 6px; border-radius: 6px; display: flex; align-items: center; transition: background var(--hoa-transition), color var(--hoa-transition); }
.ourhoa-doc-item__action:hover { background: var(--hoa-bg); color: var(--hoa-primary); }

/* ── Member directory ────────────────────────────────────────────────────── */
.ourhoa-directory { max-width: 760px; margin: 0 auto; padding-bottom: 80px; }
.ourhoa-directory__toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ourhoa-directory__search  { flex: 1; min-width: 200px; }
.ourhoa-directory__prefs   { background: var(--hoa-bg); border: 1.5px solid var(--hoa-border); border-radius: var(--hoa-radius); padding: 20px; margin-bottom: 20px; }
.ourhoa-prefs-form__note    { font-size: 13px; color: var(--hoa-text-muted); margin: 0 0 12px; }
.ourhoa-prefs-form__actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.ourhoa-prefs-form__status  { font-size: 13px; color: var(--hoa-accent); }
.ourhoa-directory__results  { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.ourhoa-member-card { background: var(--hoa-surface); border: 1.5px solid var(--hoa-border); border-radius: var(--hoa-radius); padding: 20px; display: flex; gap: 14px; align-items: flex-start; transition: box-shadow var(--hoa-transition); }
.ourhoa-member-card:hover { box-shadow: var(--hoa-shadow); }
.ourhoa-member-card__photo    { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ourhoa-member-card__initials { width: 64px; height: 64px; border-radius: 50%; background: var(--hoa-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
.ourhoa-member-card__body     { flex: 1; min-width: 0; }
.ourhoa-member-card__name     { font-weight: 600; font-size: 15px; margin: 0 0 2px; }
.ourhoa-member-card__address  { font-size: 13px; color: var(--hoa-text-muted); margin: 0 0 4px; }
.ourhoa-member-card__tagline  { font-style: italic; font-size: 13px; color: var(--hoa-text-muted); margin: 0 0 6px; }
.ourhoa-member-card__meta     { font-size: 13px; color: var(--hoa-text-muted); margin: 2px 0; }
.ourhoa-member-card__meta a   { color: var(--hoa-accent); text-decoration: none; }
.ourhoa-member-card__role     { display: inline-block; background: #EEF3F8; color: var(--hoa-primary); font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 100px; margin-top: 6px; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.ourhoa-pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.ourhoa-pagination__btn { padding: 7px 13px; border: 1.5px solid var(--hoa-border); border-radius: var(--hoa-radius-sm); background: var(--hoa-surface); color: var(--hoa-primary); font-size: 14px; cursor: pointer; transition: all var(--hoa-transition); }
.ourhoa-pagination__btn:hover { border-color: var(--hoa-primary); }
.ourhoa-pagination__btn--active { background: var(--hoa-primary); color: #fff; border-color: var(--hoa-primary); }

/* ── Profile form ────────────────────────────────────────────────────────── */
.ourhoa-profile { max-width: 720px; margin: 0 auto; padding-bottom: 80px; }
.ourhoa-profile-form { display: flex; flex-direction: column; gap: 24px; }
.ourhoa-profile__photo-section { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--hoa-bg); border-radius: var(--hoa-radius); border: 1.5px solid var(--hoa-border); }
.ourhoa-fieldset { border: 1.5px solid var(--hoa-border); border-radius: var(--hoa-radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ourhoa-fieldset__legend { font-weight: 600; font-size: 15px; color: var(--hoa-primary); padding: 0 8px; }
.ourhoa-repeater-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--hoa-bg); border-radius: var(--hoa-radius-sm); margin-bottom: 8px; }
.ourhoa-repeater-row > .ourhoa-form-row { flex: 1; }
.ourhoa-repeater-remove { background: none; border: none; color: var(--hoa-text-muted); font-size: 16px; cursor: pointer; padding: 8px; flex-shrink: 0; margin-top: 22px; border-radius: 50%; transition: background var(--hoa-transition), color var(--hoa-transition); }
.ourhoa-repeater-remove:hover { background: #FEF2F2; color: #DC2626; }
.ourhoa-profile__actions { position: sticky; bottom: 80px; background: var(--hoa-surface); padding: 14px 0; border-top: 1px solid var(--hoa-border); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ourhoa-quick-links       { grid-template-columns: repeat(2, 1fr); }
    .ourhoa-form-row--3col    { flex-direction: column; }
    .ourhoa-form-row--2col    { flex-direction: column; }
    .ourhoa-directory__results { grid-template-columns: 1fr; }
    .ourhoa-hoa-header__name  { font-size: 22px; }
    .ourhoa-login-card        { padding: 28px 20px; }
}
