@font-face {
    font-family: "GlacialIndifference";
    src: url("../assets/fonts/glacial-indifference.regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Kagitingan";
    src: url("../assets/fonts/(v2)-Kagitingan-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --mh-red: #ad2831;
    --mh-red-dark: #800e13;
    --mh-burgundy: #640d14;
    --mh-deep: #38040e;
    --mh-pink: #ffefef;
    --mh-muted: #b8afbb;
    --mh-paper: #fffafa;
    --mh-shadow: 0 18px 50px rgba(56, 4, 14, 0.15);
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--mh-burgundy);
    background: var(--mh-pink);
    font-family: "GlacialIndifference", Arial, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }

.auth-page {
    display: grid;
    place-items: center;
    padding: 32px 18px;
    background:
        radial-gradient(circle at 12% 18%, rgba(173, 40, 49, .10), transparent 28%),
        radial-gradient(circle at 90% 84%, rgba(128, 14, 19, .10), transparent 30%),
        var(--mh-pink);
}

.auth-shell { width: min(100%, 460px); }

.auth-card {
    padding: clamp(25px, 6vw, 44px);
    border: 1px solid rgba(100, 13, 20, .12);
    border-radius: 24px;
    background: var(--mh-paper);
    box-shadow: var(--mh-shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.auth-card .brand {
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(105deg, var(--mh-red-dark), var(--mh-red));
}

.brand-logo { width: 43px; height: 43px; object-fit: contain; }
.brand-name {
    font-family: "Kagitingan", sans-serif;
    font-size: 19px;
    letter-spacing: .03em;
}
.brand-name small { display: block; font: 12px "GlacialIndifference", Arial, sans-serif; opacity: .85; }

.auth-heading { margin: 34px 0 24px; }
.eyebrow {
    color: var(--mh-red);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .17em;
}
.auth-heading h1, .welcome-section h1 {
    margin: 8px 0 8px;
    color: var(--mh-deep);
    font-family: "Kagitingan", sans-serif;
    font-size: clamp(30px, 6vw, 39px);
    line-height: 1.12;
}
.auth-heading p, .welcome-section p { margin: 0; color: #75545a; line-height: 1.55; }

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label { margin-top: 8px; font-size: 14px; font-weight: 700; }
.auth-form input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #ddc8cb;
    border-radius: 10px;
    outline: none;
    color: var(--mh-deep);
    background: white;
    transition: border-color .18s, box-shadow .18s;
}
.auth-form input:focus { border-color: var(--mh-red); box-shadow: 0 0 0 3px rgba(173, 40, 49, .12); }
.password-field { position: relative; }
.password-field input { padding-right: 84px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: 0;
    color: var(--mh-red-dark);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 49px;
    margin-top: 14px;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: linear-gradient(105deg, var(--mh-red-dark), var(--mh-red));
    box-shadow: 0 7px 18px rgba(128, 14, 19, .18);
    font-weight: 700;
    transition: transform .18s, filter .18s;
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.button-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.is-loading .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-secondary { display: flex; justify-content: center; margin-top: 17px; }
.text-button {
    padding: 5px;
    border: 0;
    color: var(--mh-red-dark);
    background: transparent;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.form-message { min-height: 20px; margin: 4px 0 0; font-size: 13px; line-height: 1.45; }
.form-message:empty { display: none; }
.form-message.error { color: #a02020; }
.form-message.success { color: #246b43; }
.form-message.info { color: #75545a; }
.auth-footnote { margin: 27px 0 0; padding-top: 18px; border-top: 1px solid #eadbdd; color: #896f73; font-size: 12px; text-align: center; }
.back-link { display: block; width: fit-content; margin: 18px auto 0; color: var(--mh-burgundy); font-size: 13px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.inside-link { margin-top: 20px; }

.portal-page { background: #fff7f7; }
.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 88px;
    padding: 15px clamp(18px, 5vw, 65px);
    color: white;
    background: linear-gradient(105deg, var(--mh-deep), var(--mh-red), var(--mh-red-dark));
    box-shadow: 0 5px 24px rgba(56, 4, 14, .18);
}
.header-actions { display: flex; align-items: center; gap: 14px; }
.member-chip { max-width: 260px; overflow: hidden; color: #fff0f0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.outline-button { padding: 9px 16px; border: 1px solid rgba(255,255,255,.65); border-radius: 9px; color: white; background: transparent; font-weight: 700; }
.outline-button:hover { color: var(--mh-deep); background: white; }

.portal-main { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 58px 0 50px; }
.welcome-section { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.welcome-section h1 { font-size: clamp(34px, 6vw, 48px); }
.role-pill { padding: 8px 13px; border: 1px solid #e6c7cb; border-radius: 999px; color: var(--mh-red-dark); background: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.portal-card {
    display: flex;
    min-height: 205px;
    flex-direction: column;
    align-items: flex-start;
    padding: 23px;
    border: 1px solid #edd9dc;
    border-radius: 17px;
    color: var(--mh-burgundy);
    background: white;
    box-shadow: 0 8px 24px rgba(56, 4, 14, .055);
    text-decoration: none;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
a.portal-card:hover { transform: translateY(-3px); border-color: #d59da3; box-shadow: 0 13px 30px rgba(56, 4, 14, .10); }
.card-icon { display: grid; width: 39px; height: 39px; place-items: center; margin-bottom: 17px; border-radius: 11px; color: white; background: var(--mh-red-dark); font-size: 21px; font-weight: 700; }
.card-title { color: var(--mh-deep); font-family: "Kagitingan", sans-serif; font-size: 20px; }
.card-description { margin-top: 8px; color: #80666a; font-size: 13px; line-height: 1.5; }
.card-status { margin-top: auto; padding-top: 16px; color: var(--mh-red); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.role-card { background: #fffafa; }
.profile-panel { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 25px; padding: 24px; border: 1px solid #edd9dc; border-radius: 17px; background: white; }
.profile-panel h2 { margin: 6px 0 3px; color: var(--mh-deep); font-family: "Kagitingan", sans-serif; font-size: 23px; }
.profile-panel p { margin: 0; color: #80666a; font-size: 13px; }
.profile-details { display: flex; gap: 35px; margin: 0; }
.profile-details dt { color: #967c80; font-size: 11px; }
.profile-details dd { margin: 5px 0 0; color: var(--mh-burgundy); font-size: 13px; font-weight: 700; }
.portal-disclaimer { margin: 25px 0 0; color: #987f83; font-size: 12px; line-height: 1.5; text-align: center; }
.notice { margin-bottom: 20px; padding: 15px 17px; border-radius: 10px; line-height: 1.5; }
.notice.error { border: 1px solid #e6b9b9; color: #8d2020; background: #fff0f0; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
    .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-panel { align-items: flex-start; flex-direction: column; }
    .profile-details { flex-wrap: wrap; gap: 18px 30px; }
}

@media (max-width: 520px) {
    .portal-header { align-items: flex-start; flex-direction: column; }
    .header-actions { width: 100%; justify-content: space-between; }
    .welcome-section { align-items: flex-start; flex-direction: column; }
    .portal-grid { grid-template-columns: 1fr; }
    .portal-card { min-height: 175px; }
}

/* =========================================
   ADMINISTRATIVE MEMBER MANAGEMENT
   ========================================= */
.admin-members-page .header-link {
    display: inline-flex; align-items: center; min-height: 38px;
    text-decoration: none; font-size: 13px;
}
.admin-members-page .notice.success {
    border: 1px solid #b7d8c2; color: #245d38; background: #effaf2;
}
.admin-members-page .notice.error a { color: inherit; font-weight: 700; margin-left: 8px; }
.admin-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 19px;
}
.admin-stat-card {
    display: flex; min-height: 105px; flex-direction: column; justify-content: space-between;
    padding: 17px 19px; border: 1px solid #edd9dc; border-radius: 14px;
    background: #fff; box-shadow: 0 6px 20px rgba(56, 4, 14, .045);
}
.admin-stat-label { color: #896f73; font-size: 12px; }
.admin-stat-card strong {
    color: var(--mh-deep); font-family: "Kagitingan", sans-serif; font-size: 31px; line-height: 1;
}
.admin-panel {
    margin-top: 20px; padding: clamp(19px, 3vw, 28px); border: 1px solid #edd9dc;
    border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(56, 4, 14, .045);
}
.admin-panel-heading {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px;
}
.admin-panel-heading h2 {
    margin: 6px 0 5px; color: var(--mh-deep); font-family: "Kagitingan", sans-serif; font-size: 25px;
}
.admin-panel-heading p { margin: 0; color: #80666a; font-size: 13px; line-height: 1.5; }
.invite-form { display: grid; grid-template-columns: 1.1fr 1.3fr .8fr auto; align-items: end; gap: 13px; }
.admin-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.admin-field label, .filter-field > span { color: #6f5055; font-size: 12px; font-weight: 700; }
.admin-field input, .admin-field select, .filter-field select,
.member-name-input, .member-role-select, .search-field input {
    min-width: 0; min-height: 43px; padding: 9px 11px; border: 1px solid #ddc8cb;
    border-radius: 9px; outline: none; color: var(--mh-deep); background: #fff; font: inherit; font-size: 13px;
}
.admin-field input:focus, .admin-field select:focus, .filter-field select:focus,
.member-name-input:focus, .member-role-select:focus, .search-field input:focus {
    border-color: var(--mh-red); box-shadow: 0 0 0 3px rgba(173, 40, 49, .10);
}
.invite-submit { min-width: 150px; min-height: 43px; margin: 0; padding: 10px 14px; font-size: 13px; }
.invite-panel .form-message { margin-top: 12px; }
.secondary-button {
    min-height: 39px; padding: 8px 12px; border: 1px solid #d9b9be; border-radius: 9px;
    color: var(--mh-red-dark); background: #fffafa; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.secondary-button:hover { background: #fff0f1; }
.secondary-button:disabled { opacity: .65; cursor: wait; }
.members-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.search-field {
    display: flex; width: min(100%, 420px); align-items: center; gap: 9px; padding-left: 12px;
    border: 1px solid #ddc8cb; border-radius: 9px; color: #9b7b80; background: #fff;
}
.search-field:focus-within { border-color: var(--mh-red); box-shadow: 0 0 0 3px rgba(173, 40, 49, .10); }
.search-field input { width: 100%; border: 0; box-shadow: none !important; }
.search-field input:focus { border: 0; }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field select { min-width: 145px; }
.members-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #f0e1e3; border-radius: 11px; }
.members-table { width: 100%; min-width: 900px; border-collapse: collapse; text-align: left; }
.members-table th {
    padding: 12px 11px; color: #80666a; background: #fff7f7; font-size: 11px;
    font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.members-table td { padding: 10px 11px; border-top: 1px solid #f2e7e8; color: #68484e; font-size: 12px; vertical-align: middle; }
.members-table tbody tr:hover { background: #fffafa; }
.members-table .table-placeholder { padding: 28px; color: #927b7f; text-align: center; }
.member-name-cell { min-width: 180px; }
.member-name-input { width: 100%; min-height: 36px; padding: 7px 8px; font-size: 12px; }
.member-email-cell { min-width: 200px; overflow-wrap: anywhere; }
.member-role-select { min-width: 125px; min-height: 36px; padding: 6px 8px; font-size: 12px; }
.member-role-select:disabled { color: #866e72; background: #f8f2f3; opacity: 1; }
.self-label { display: block; margin: 4px 0 0 2px; color: #967c80; font-size: 10px; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge.active { color: #28633d; background: #eaf6ed; }
.status-badge.pending { color: #805514; background: #fff5dd; }
.status-badge.suspended { color: #8e2929; background: #fdeaea; }
.member-actions { display: flex; align-items: center; gap: 6px; }
.small-primary-button, .small-danger-button, .small-secondary-button {
    min-height: 32px; padding: 6px 9px; border: 1px solid transparent; border-radius: 7px;
    font: inherit; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.small-primary-button { color: white; background: var(--mh-red-dark); }
.small-primary-button:hover { background: var(--mh-red); }
.small-danger-button { border-color: #efc5c5; color: #9b3030; background: #fff4f4; }
.small-danger-button:hover { background: #ffe8e8; }
.small-secondary-button { border-color: #c4dfca; color: #28633d; background: #f0faf2; }
.small-secondary-button:hover { background: #e5f5e9; }
.small-primary-button:disabled, .small-danger-button:disabled, .small-secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.empty-state { padding: 22px; color: #927b7f; text-align: center; font-size: 13px; }
.admin-footnote { margin: 15px 0 0; color: #987f83; font-size: 11px; line-height: 1.5; }

@media (max-width: 900px) {
    .invite-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invite-submit { width: 100%; }
}
@media (max-width: 650px) {
    .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .members-heading { align-items: flex-start; flex-direction: column; }
    .members-toolbar { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; }
    .filter-field select { width: 100%; }
    .invite-form { grid-template-columns: 1fr; }
    .invite-submit { width: 100%; }
    .admin-members-page .header-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* Google OAuth button — aligned with the Mega Harpy authentication UI. */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: #987f83;
    font-size: 12px;
    font-weight: 700;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #eadbdd;
}
.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 49px;
    padding: 11px 16px;
    border: 1px solid #d9cacc;
    border-radius: 10px;
    color: #3f3436;
    background: #fff;
    font-weight: 700;
    transition: border-color .18s, background .18s, transform .18s;
}
.google-button:hover:not(:disabled) {
    border-color: #bda5a9;
    background: #fffafa;
    transform: translateY(-1px);
}
.google-button:active:not(:disabled) { transform: translateY(0); }
.google-button:disabled { cursor: wait; opacity: .65; }
.google-mark {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    color: #4285f4;
    font: 800 22px/1 Arial, sans-serif;
}
