/* =====================================================================
   HCF Activity Management System — Activity Upload Portal
   Premium SaaS UI • Glassmorphism • GSAP-ready
   ===================================================================== */

:root {
  --primary: #0B3D2E;
  --primary-600: #0e4a38;
  --primary-300: #2f7a5f;
  --secondary: #D4AF37;
  --secondary-600: #c39f2c;
  --bg: #F7F8F9;
  --ink: #16241d;
  --muted: #5b6b63;
  --line: #e4e8e6;
  --danger: #d7433b;
  --success: #1f9d63;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-brd: rgba(255, 255, 255, 0.55);
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px -18px rgba(11, 61, 46, 0.28);
  --shadow-sm: 0 8px 24px -12px rgba(11, 61, 46, 0.25);
  --ring: 0 0 0 4px rgba(212, 175, 55, 0.22);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }
a { text-decoration: none; }
.fw-600 { font-weight: 600; }

/* ================= ANIMATED BACKGROUND ================= */
.bg-canvas {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 80% -10%, #eaf3ee 0%, transparent 60%),
    linear-gradient(180deg, #f2f6f4 0%, var(--bg) 45%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
  animation: float 18s var(--ease) infinite;
}
.blob-1 { width: 460px; height: 460px; top: -120px; left: -80px;
  background: radial-gradient(circle at 30% 30%, #2f7a5f, #0B3D2E); opacity: .28; }
.blob-2 { width: 520px; height: 520px; top: 10%; right: -160px;
  background: radial-gradient(circle at 30% 30%, #f0d97a, #D4AF37); opacity: .22; animation-delay: -6s; }
.blob-3 { width: 380px; height: 380px; bottom: -140px; left: 30%;
  background: radial-gradient(circle at 30% 30%, #58b88f, #0B3D2E); opacity: .18; animation-delay: -11s; }
.grid-overlay {
  position: absolute; inset: 0; opacity: .35;
  background-image:
    linear-gradient(rgba(11,61,46,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,61,46,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 0%, #000, transparent 75%);
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,-30px) scale(1.06); }
}

/* ================= GLASS UTILITY ================= */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ================= HEADER ================= */
.app-header {
  position: sticky; top: 0; z-index: 40;
  padding: 14px 0;
  background: rgba(247, 248, 249, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--primary); }
.brand-logo {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--primary), #14664c);
  box-shadow: var(--shadow-sm);
}
.brand-logo.sm { width: 38px; height: 38px; font-size: 17px; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 700; font-size: 1.02rem; }
.brand-sub { font-size: .72rem; color: var(--secondary-600); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }

.btn-ghost {
  display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 12px;
  color: var(--primary); font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line); background: rgba(255,255,255,.6);
  transition: all .25s var(--ease);
}
.btn-ghost:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ================= HERO ================= */
.hero { position: relative; padding: 68px 0 92px; }
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border-radius: 999px; font-weight: 600; font-size: .82rem;
  color: var(--primary); background: rgba(212,175,55,.16);
  border: 1px solid rgba(212,175,55,.35);
}
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--secondary);
  box-shadow: 0 0 0 0 rgba(212,175,55,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(212,175,55,0); } 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); } }

.hero-title { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.08; margin: 18px 0 14px; color: var(--primary); }
.grad-text { background: linear-gradient(100deg, var(--secondary), #b8860b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.08rem; color: var(--muted); max-width: 560px; margin-bottom: 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-card { padding: 22px; }
.hero-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hero-card-head i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(11,61,46,.08); color: var(--primary); font-size: 18px; }
.hero-card-head small { display: block; color: var(--muted); font-size: .74rem; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { padding: 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,.6);
  border: 1px solid var(--line); }
.stat-num { display: block; font-size: 1.7rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { display: block; margin-top: 6px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.stat-label i { color: var(--secondary-600); margin-right: 4px; }
.hero-card-foot { margin-top: 16px; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero-card-foot i { color: var(--success); }

.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; height: 60px;
  background: var(--bg);
  -webkit-mask: radial-gradient(80% 60px at 50% 0, transparent 98%, #000) 0 0/100% 100%;
  mask: radial-gradient(80% 60px at 50% 0, transparent 98%, #000) 0 0/100% 100%;
}

/* ================= BUTTONS ================= */
.btn { font-weight: 600; border-radius: 14px; transition: all .25s var(--ease); }
.btn-gold { background: linear-gradient(135deg, var(--secondary), #b8860b); color: #1c1403; border: none;
  box-shadow: 0 12px 28px -12px rgba(212,175,55,.7); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(212,175,55,.85); color: #1c1403; }
.btn-primary-hcf { background: var(--primary); color: #fff; border: none; padding: 11px 22px; }
.btn-primary-hcf:hover { background: var(--primary-600); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-outline-light { border: 1px solid rgba(11,61,46,.25); color: var(--primary); background: rgba(255,255,255,.5); }
.btn-outline-light:hover { background: var(--primary); color: #fff; }
.btn-ghost-dark { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 11px 20px; }
.btn-ghost-dark:hover { color: var(--primary); border-color: var(--primary-300); }

/* ================= STEPPER ================= */
.form-shell { position: relative; z-index: 2; padding-bottom: 90px; }
.stepper { position: relative; display: flex; gap: 6px; padding: 12px; margin: -60px auto 26px; max-width: 900px; overflow-x: auto; }
.step { flex: 1 1 auto; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 10px; border: none; background: transparent; border-radius: 12px; color: var(--muted);
  font-weight: 600; font-size: .88rem; cursor: pointer; transition: all .25s var(--ease); white-space: nowrap; }
.step span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(11,61,46,.08); color: var(--primary); font-size: .82rem; font-weight: 700; transition: all .25s var(--ease); }
.step.active { color: var(--primary); background: rgba(212,175,55,.14); }
.step.active span { background: var(--secondary); color: #1c1403; }
.step.done span { background: var(--success); color: #fff; }
.stepper-progress { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 3px; border-radius: 3px; background: var(--line); }
.stepper-progress span { display: block; height: 100%; width: 20%; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width .4s var(--ease); }

/* ================= FORM BLOCKS ================= */
.card-block { padding: 30px; margin: 0 auto; max-width: 900px; }
.form-step { display: none; }
.form-step.is-active { display: block; }

.block-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.block-icon { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 16px;
  font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--primary), #14664c); box-shadow: var(--shadow-sm); }
.block-head h2 { font-size: 1.4rem; margin: 0; color: var(--primary); }
.block-head p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }

.sub-title { font-size: 1.02rem; color: var(--primary); margin: 6px 0 14px; display: flex; align-items: center; gap: 9px; }
.sub-title small { color: var(--muted); font-weight: 500; }
.sub-title i { color: var(--secondary-600); }

/* ================= FLOATING LABEL FIELDS ================= */
.float-field { position: relative; }
.float-field .form-control,
.float-field .form-select {
  height: 58px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  padding: 22px 16px 8px; font-size: .96rem; background: rgba(255,255,255,.85);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.float-field textarea.form-control { height: auto; padding-top: 26px; resize: vertical; }
.float-field .form-control:focus,
.float-field .form-select:focus {
  border-color: var(--secondary); box-shadow: var(--ring); background: #fff; outline: none;
}
.float-field label {
  position: absolute; left: 16px; top: 18px; color: var(--muted); font-size: .96rem;
  pointer-events: none; transition: all .18s var(--ease); background: transparent;
}
.float-field label i { color: var(--secondary-600); margin-right: 5px; font-size: .85em; }
.float-field .form-control:focus + label,
.float-field .form-control:not(:placeholder-shown) + label,
.float-field .form-select:focus + label,
.float-field .form-select:valid + label,
.float-field label.is-lifted {
  top: 8px; font-size: .72rem; font-weight: 600; color: var(--primary);
}
.field-hint, .field-error { font-size: .74rem; margin-top: 5px; padding-left: 4px; }
.field-hint { color: var(--muted); }
.field-error { color: var(--danger); display: none; }
.float-field.invalid .form-control,
.float-field.invalid .form-select { border-color: var(--danger); }
.float-field.invalid .field-error { display: block; }
.float-field.valid .form-control,
.float-field.valid .form-select { border-color: var(--success); }

.char-counter { position: absolute; right: 12px; bottom: 8px; font-size: .7rem; color: var(--muted); }
.mini-link { background: none; border: none; color: var(--primary-300); font-size: .8rem; font-weight: 600;
  padding: 6px 2px; cursor: pointer; }
.mini-link:hover { color: var(--secondary-600); }

.step-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; }

/* ================= EXPENSE TABLE ================= */
.expense-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.expense-table { width: 100%; border-collapse: collapse; }
.expense-table th { background: rgba(11,61,46,.05); color: var(--primary); font-size: .8rem; font-weight: 600;
  text-align: left; padding: 12px 14px; }
.expense-table td { padding: 8px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.expense-table input { width: 100%; border: 1px solid transparent; background: transparent; padding: 9px 10px;
  border-radius: 10px; font-size: .92rem; }
.expense-table input:focus { outline: none; border-color: var(--secondary); background: #fff; box-shadow: var(--ring); }
.exp-index { color: var(--muted); font-weight: 600; text-align: center; }
.exp-del { border: none; background: rgba(215,67,59,.1); color: var(--danger); width: 34px; height: 34px;
  border-radius: 10px; cursor: pointer; transition: all .2s var(--ease); }
.exp-del:hover { background: var(--danger); color: #fff; }
.expense-total { font-weight: 800; color: var(--primary); font-size: 1.02rem; }
.expense-table tfoot td { border-top: 2px solid var(--line); background: rgba(212,175,55,.06); }
.btn-add-row { width: 100%; border: 1.5px dashed var(--primary-300); background: rgba(11,61,46,.03);
  color: var(--primary); font-weight: 600; padding: 12px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.btn-add-row:hover { background: rgba(11,61,46,.07); }

/* ================= DROPZONES + PREVIEWS ================= */
.dropzone { border: 2px dashed var(--primary-300); border-radius: var(--radius-sm); padding: 30px 20px;
  text-align: center; background: rgba(11,61,46,.02); cursor: pointer; transition: all .25s var(--ease); }
.dropzone:hover, .dropzone:focus-visible { background: rgba(212,175,55,.08); border-color: var(--secondary); outline: none; }
.dropzone.dragover { background: rgba(212,175,55,.16); border-color: var(--secondary); transform: scale(1.01); }
.dz-icon { font-size: 34px; color: var(--secondary-600); margin-bottom: 10px; }
.dz-inner p { margin: 4px 0; color: var(--ink); }
.dz-inner small { color: var(--muted); }
.dz-browse { color: var(--primary); font-weight: 700; text-decoration: underline; }

.preview-counter { margin: 10px 0; font-size: .82rem; color: var(--muted); font-weight: 600; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 14px; }
.preview-item { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: #fff; aspect-ratio: 1 / 1; box-shadow: var(--shadow-sm); animation: pop .3s var(--ease); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .file-icon { width: 100%; height: 100%; display: grid; place-items: center; color: var(--danger);
  font-size: 34px; background: rgba(215,67,59,.06); }
.preview-item .file-name { position: absolute; left: 0; right: 0; bottom: 0; font-size: .64rem; padding: 5px 6px;
  background: rgba(0,0,0,.55); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-item .rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: none;
  border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; display: grid; place-items: center;
  font-size: .72rem; transition: all .2s var(--ease); }
.preview-item .rm:hover { background: var(--danger); transform: scale(1.1); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* ================= NEEDS ================= */
.needs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.need-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: rgba(255,255,255,.7);
  cursor: pointer; transition: all .22s var(--ease); }
.need-card input { position: absolute; opacity: 0; pointer-events: none; }
.need-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(11,61,46,.07); color: var(--primary); font-size: 19px; transition: all .22s var(--ease); }
.need-tx { font-weight: 600; font-size: .92rem; color: var(--ink); }
.need-check { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .7rem; background: var(--line); color: transparent; transition: all .22s var(--ease); }
.need-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--primary-300); }
.need-card:has(input:checked) { border-color: var(--secondary); background: rgba(212,175,55,.1); }
.need-card:has(input:checked) .need-ic { background: var(--primary); color: #fff; }
.need-card:has(input:checked) .need-check { background: var(--success); color: #fff; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; font-size: .88rem; color: var(--muted); }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 18px; }
.btn-submit { min-width: 240px; }

/* ================= FOOTER ================= */
.app-footer { border-top: 1px solid var(--line); padding: 26px 0; margin-top: 20px;
  background: rgba(255,255,255,.55); backdrop-filter: blur(10px); }
.app-footer small { color: var(--muted); }
.foot-links { display: flex; align-items: center; gap: 18px; font-size: .86rem; }
.foot-links a { color: var(--primary); font-weight: 600; }
.foot-links a:hover { color: var(--secondary-600); }
.foot-links span { color: var(--muted); }

/* ================= SUBMIT OVERLAY ================= */
.submit-overlay { position: fixed; inset: 0; z-index: 90; display: none; place-items: center;
  background: rgba(11,61,46,.35); backdrop-filter: blur(6px); }
.submit-overlay.show { display: grid; }
.submit-card { width: min(420px, 90vw); padding: 40px 34px; text-align: center; }
.submit-card h3 { color: var(--primary); font-size: 1.25rem; margin: 20px 0 8px; }
.submit-card p { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.loader-ring { position: relative; width: 74px; height: 74px; margin: 0 auto; }
.loader-ring span { position: absolute; inset: 0; border: 4px solid transparent; border-radius: 50%;
  border-top-color: var(--secondary); animation: spin 1s linear infinite; }
.loader-ring span:nth-child(2) { inset: 9px; border-top-color: var(--primary); animation-duration: 1.4s; }
.loader-ring span:nth-child(3) { inset: 18px; border-top-color: var(--primary-300); animation-duration: 1.8s; }
@keyframes spin { to { transform: rotate(360deg); } }
.upload-progress { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width .3s var(--ease); }
.upload-pct { margin-top: 10px; font-weight: 700; color: var(--primary); }

/* ================= TOASTS ================= */
.toast-host { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column;
  gap: 12px; max-width: 360px; }
.hcf-toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: #fff; box-shadow: var(--shadow); border-left: 4px solid var(--primary);
  animation: toastIn .35s var(--ease); }
.hcf-toast.success { border-left-color: var(--success); }
.hcf-toast.error { border-left-color: var(--danger); }
.hcf-toast.info { border-left-color: var(--secondary); }
.hcf-toast .t-ic { font-size: 18px; margin-top: 1px; }
.hcf-toast.success .t-ic { color: var(--success); }
.hcf-toast.error .t-ic { color: var(--danger); }
.hcf-toast.info .t-ic { color: var(--secondary-600); }
.hcf-toast .t-body { flex: 1; }
.hcf-toast .t-title { font-weight: 700; font-size: .9rem; color: var(--ink); }
.hcf-toast .t-msg { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.hcf-toast .t-close { border: none; background: none; color: var(--muted); cursor: pointer; font-size: .9rem; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.hcf-toast.leaving { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ================= RESPONSIVE ================= */
@media (max-width: 991px) {
  .hero { padding: 46px 0 70px; }
  .card-block { padding: 24px 20px; }
}
@media (max-width: 575px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .block-head h2 { font-size: 1.2rem; }
  .btn-submit { min-width: 100%; }
  .step-nav { flex-direction: column-reverse; gap: 12px; }
  .step-nav .btn { width: 100%; }
  .toast-host { left: 12px; right: 12px; max-width: none; }
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
