/* =====================================================================
   CNOBA - Canada Nalandians Alumni in Alberta
   Theme: maroon (#701010) + silver
   ===================================================================== */

:root {
  --maroon:        #701010;
  --maroon-dark:   #4d0b0b;
  --maroon-light:  #8f1c1c;
  --maroon-tint:   #f7eded;

  --silver:        #b7bcc2;
  --silver-dark:   #8a9099;
  --silver-mid:    #ced3d8;
  --silver-light:  #e9ecf0;
  --silver-fog:    #f4f6f8;

  --ink:           #2a2d31;
  --muted:         #6b7178;
  --paper:         #ffffff;
  --line:          #dde2e7;

  --ok:            #1c7a4a;
  --ok-tint:       #e7f4ec;
  --warn:          #9a6a00;
  --warn-tint:     #fdf3dd;
  --err:           #b3261e;
  --err-tint:      #fbe9e8;

  --radius:        14px;
  --radius-sm:     9px;
  --shadow:        0 10px 30px rgba(42,45,49,.09);
  --shadow-sm:     0 3px 10px rgba(42,45,49,.07);
  --ring:          0 0 0 3px rgba(112,16,16,.16);
  --font:          'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display:  'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 100% -10%, rgba(112,16,16,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(138,144,153,.16), transparent 55%),
    var(--silver-fog);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); color: var(--maroon); line-height: 1.2; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ------------------------------- Header ------------------------------ */
.site-header {
  background: linear-gradient(120deg, var(--maroon-dark), var(--maroon) 55%, var(--maroon-light));
  border-bottom: 3px solid var(--silver);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 4px 18px rgba(45,10,10,.25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 13px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 52px; height: 52px; object-fit: contain;
  background: #fff; border-radius: 12px; padding: 4px;
  border: 2px solid var(--silver);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.32rem; letter-spacing: .3px; }
.brand-text small { color: var(--silver-light); font-size: .74rem; letter-spacing: .2px; }

.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.main-nav > a:not(.btn) {
  color: #fff; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .93rem;
}
.main-nav > a:not(.btn):hover { background: rgba(255,255,255,.13); text-decoration: none; }
.main-nav > a.active { background: rgba(255,255,255,.18); }
.nav-user { display: flex; align-items: center; gap: 8px; color: #fff; padding: 4px 6px; }
.nav-user img, .nav-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--silver); background: var(--silver-light); color: var(--maroon);
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
}
.nav-user-name { font-size: .9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- Buttons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 600; cursor: pointer; transition: .15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--maroon); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--maroon-light); }
.btn-silver { background: var(--silver-light); color: var(--ink); border-color: var(--silver); }
.btn-silver:hover { background: var(--silver-mid); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-outline { background: #fff; color: var(--maroon); border-color: var(--maroon); }
.btn-outline:hover { background: var(--maroon-tint); }
.btn-sm { padding: 8px 13px; font-size: .86rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* --------------------------------- Main ------------------------------ */
.page-main { padding: 30px 0 60px; min-height: 60vh; }

/* -------------------------------- Alerts ----------------------------- */
.alert {
  border-radius: var(--radius-sm); padding: 13px 16px; margin: 0 0 18px;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm);
  font-size: .94rem;
}
.alert-success { border-color: #bfe3cd; background: var(--ok-tint); color: #135d38; }
.alert-error   { border-color: #f0c2bf; background: var(--err-tint); color: #8f1e18; }
.alert-info    { border-color: var(--silver-mid); background: var(--silver-light); color: #444b52; }
.alert-warn    { border-color: #ecd9a8; background: var(--warn-tint); color: #7a5400; }

/* --------------------------------- Hero ------------------------------ */
.hero { text-align: center; padding: 8px 0 26px; }
.hero-logo {
  width: 168px; margin: 0 auto 12px; background: #fff; border-radius: 20px; padding: 10px;
  border: 2px solid var(--silver); box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 6px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.hero .eyebrow {
  display: inline-block; margin-bottom: 12px; padding: 5px 14px; border-radius: 999px;
  background: var(--maroon-tint); color: var(--maroon); font-weight: 700;
  font-size: .76rem; letter-spacing: 1.4px; text-transform: uppercase;
  border: 1px solid #ecd6d6;
}

/* ------------------------------- Layout ------------------------------ */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card + .card { margin-top: 22px; }
.card-head { padding: 18px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg,#fff,var(--silver-fog)); }
.card-head h2 { margin: 0; font-size: 1.22rem; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.card-body { padding: 24px; }

/* ------------------------------ Sections ----------------------------- */
.section { border: 0; margin: 0; padding: 0 0 6px; }
.section + .section { margin-top: 8px; padding-top: 22px; border-top: 1px dashed var(--line); }
.section-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.section-num {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--maroon); color: #fff; font-weight: 700; font-family: var(--font-display);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
}
.section-head h3 { margin: 0; font-size: 1.12rem; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }

/* ------------------------------- Fields ------------------------------ */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px 18px; }
.col-2 { grid-column: 1 / -1; }
@media (max-width: 680px) { .grid, .grid-3 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field > label .req { color: var(--err); margin-left: 2px; }
.field .sub { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.field .err-msg { color: var(--err); font-size: .8rem; display: none; }
.field.invalid .err-msg { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err); background: #fffafa; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--silver-mid); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--maroon); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #a7adb4; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7178' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.field-note { font-size: .78rem; color: var(--muted); }
.field-note.ok { color: var(--ok); }
.field-note.bad { color: var(--err); }

/* radio pills */
.pills { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pill {
  position: relative; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 9px 15px; border: 1px solid var(--silver-mid); border-radius: 999px;
  background: #fff; font-size: .9rem; font-weight: 600; color: var(--ink); transition: .15s;
}
.pill:hover { border-color: var(--maroon); }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--silver); transition: .15s; }
.pill:has(input:checked) { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.pill:has(input:checked) .dot { background: #fff; }

/* address autocomplete */
.ac { position: relative; }
.ac-list {
  position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--silver-mid); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); max-height: 260px; overflow: auto; display: none;
}
.ac-list.open { display: block; }
.ac-item { padding: 10px 13px; cursor: pointer; font-size: .9rem; border-bottom: 1px solid var(--silver-light); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.active { background: var(--maroon-tint); }
.ac-item small { display: block; color: var(--muted); font-size: .78rem; }
.ac-empty { padding: 10px 13px; color: var(--muted); font-size: .85rem; }

/* verification badge */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-pending { background: var(--warn-tint); color: var(--warn); }
.badge-admin { background: var(--maroon); color: #fff; }
.badge-user { background: var(--silver-light); color: #4b5157; }

/* ------------------------------ Photos ------------------------------- */
.photo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.photo-preview {
  width: 132px; height: 132px; border-radius: 16px; flex: none; overflow: hidden;
  border: 2px dashed var(--silver); background: var(--silver-fog);
  display: grid; place-items: center; color: var(--silver-dark); text-align: center; font-size: .78rem;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; flex-direction: column; gap: 10px; }
.photo-actions .hint { color: var(--muted); font-size: .8rem; max-width: 320px; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* crop modal */
.modal {
  position: fixed; inset: 0; z-index: 80; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(20,22,25,.62); backdrop-filter: blur(2px);
}
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); width: min(760px, 100%); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg,#fff,var(--silver-fog)); }
.modal-head h3 { margin: 0; font-size: 1.08rem; }
.modal-body { padding: 18px; }
.modal-body .crop-stage { max-height: 62vh; background: #111; border-radius: 10px; overflow: hidden; }
.modal-body img { max-width: 100%; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--silver-fog); }
.x-btn { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; }

/* ------------------------------ Auth card ---------------------------- */
.side-card { position: sticky; top: 90px; }
.side-card .card-body { padding: 20px; }
.auth-note { font-size: .85rem; color: var(--muted); margin: 0 0 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--silver-dark); font-size: .8rem; margin: 16px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 11px; border: 1px solid var(--silver-mid); border-radius: 10px; background: #fff;
  font-weight: 600; color: var(--ink); cursor: pointer; font: inherit;
}
.google-btn:hover { background: var(--silver-fog); text-decoration: none; }
.google-btn svg { width: 18px; height: 18px; }
.benefit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.benefit-list li { display: flex; gap: 9px; font-size: .87rem; color: #494f55; }
.benefit-list li::before { content: "✓"; color: var(--maroon); font-weight: 800; }

/* ------------------------------ Directory ---------------------------- */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.member-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.member-top { display: flex; gap: 13px; padding: 16px; align-items: center; }
.member-photo { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 2px solid var(--silver); background: var(--silver-fog); flex: none; }
.member-photo.ph { display: grid; place-items: center; color: var(--maroon); font-weight: 700; }
.member-name { font-weight: 700; color: var(--ink); font-size: 1rem; margin: 0; }
.member-sub { color: var(--muted); font-size: .82rem; margin: 2px 0 0; }
.member-body { padding: 0 16px 16px; display: grid; gap: 7px; font-size: .86rem; }
.member-body .row { display: flex; gap: 8px; color: #4a5057; }
.member-body .row b { color: var(--ink); font-weight: 600; min-width: 74px; }
.member-body .row span { word-break: break-word; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip { background: var(--maroon-tint); color: var(--maroon); border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 600; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ------------------------------- Tables ------------------------------ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: var(--silver-fog); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
table.data tr:hover td { background: #fcfaf9; }

/* ------------------------------- Footer ------------------------------ */
.site-footer { background: #23262a; color: var(--silver-light); margin-top: 40px; border-top: 3px solid var(--maroon); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 0; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-logo { width: 46px; height: 46px; border-radius: 10px; background: #fff; padding: 4px; object-fit: contain; }
.footer-brand strong { color: #fff; }
.footer-brand p { margin: 2px 0 0; font-size: .82rem; color: var(--silver); }
.footer-meta { font-size: .84rem; color: var(--silver); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-meta a { color: var(--silver-light); }
.dot { opacity: .5; }

/* ------------------------------ Utility ------------------------------ */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 18px; } .mt-3 { margin-top: 28px; }
.mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 18px; }
.stack { display: grid; gap: 14px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-box { font-family: ui-monospace, Consolas, monospace; background: var(--silver-fog); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; word-break: break-all; font-size: .84rem; }
.hidden { display: none !important; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .87rem; color: #4a5057; }
.consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--maroon); }

.form-footer { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-footer .hint { font-size: .82rem; color: var(--muted); max-width: 420px; }
