/* styles.css */

:root{
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e5e7eb;
  --soft: #eef4ff;
  --accent: #b23a2f;
  --accent-2: #2f6fed;
  --warn-bg: #fff7db;
  --warn-line: #f2d07b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(16,24,40,0.08);
  --shadow-soft: 0 2px 10px rgba(16,24,40,0.06);
  --focus: 0 0 0 4px rgba(47,111,237,0.18);
  --gap: 18px;
  --max: 980px;
  --tap: 44px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container{
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero{
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 55%, var(--bg) 100%);
}
.hero__topbar, .hero__bottombar{
  height: 14px;
  background: var(--accent);
}
.hero__inner{
  padding: 18px 0 22px;
}

.hero__brand{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.brand__org{
  font-size: 12px;
  color: var(--muted);
}
.brand__name{
  font-size: 13px;
  font-weight: 600;
}

.brand__center{
  text-align: center;
}
.brand__thanks{
  font-weight: 900;
  font-size: clamp(38px, 4.4vw, 56px);
  letter-spacing: 1px;
  color: var(--accent);
  line-height: 1;
}
.brand__thanks .heart{
  display: inline-block;
  transform: translateY(-3px);
  color: #7aa2df;
  margin: 0 2px;
}
.brand__tag{
  margin-top: 6px;
  font-weight: 700;
  color: var(--accent);
}

.logo{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}
.logo__image{
  display: block;
  height: 48px;
  width: auto;
}
.logo__mark{
  display: inline-flex;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  background: rgba(178,58,47,0.10);
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
}
.logo__text{
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  text-align: left;
}

.hero__titleblock{
  text-align: center;
  padding: 18px 0 4px;
}
h1{
  margin: 18px 0 8px;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.02em;
}
.muted{ color: var(--muted); margin: 4px 0; }
.muted.small{ font-size: 13px; }
.profile{
  text-align: center;
  padding: 12px 0 6px;
}
.profile__avatar{
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 999px;
  overflow: hidden;
  border: 6px solid #f2f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.profile__initials{
  font-weight: 800;
  color: var(--accent);
  font-size: 36px;
}
.profile__name{
  margin-top: 12px;
  font-size: 18px;
}
.link{
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link:hover{ color: var(--ink); }

.form{
  padding: 18px 0 44px;
  display: grid;
  gap: 40px;
}

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.modal{
  position: fixed;
  inset: 0;
  background: rgba(16,24,40,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal[hidden]{ display: none; }
.modal__card{ width: min(360px, 100%); }

.profile--clickable{ cursor: pointer; }

.card__title{
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.card__title--small{
  font-size: 14px;
}
.card__row{
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px);
  gap: var(--gap);
  align-items: start;
}

.grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.span-2{ grid-column: span 2; }

.field label{
  display: inline-flex;
  gap: 6px;
  font-size: 14px;
  color: #344054;
  margin-bottom: 8px;
  font-weight: 600;
}
.req{ color: var(--accent); }

.field input,
.field select{
  width: 100%;
  height: var(--tap);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  font-size: 16px;
  outline: none;
}
.field input::placeholder{ color: #98a2b3; }

.field input:focus,
.field select:focus{
  border-color: rgba(47,111,237,0.55);
  box-shadow: var(--focus);
}

.field input[type="file"]{
  border: none;
  padding: 0;
  height: auto;
  background: transparent;
  box-shadow: none;
}
.field input[type="file"]:focus{
  border-color: transparent;
  box-shadow: none;
}

.field select{
  padding-right: 42px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 20px) 18px,
    calc(100% - 14px) 18px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}

.inline{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.hint{
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.alert{
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: #7a5a00;
  text-align: center;
}

.is-invalid{
  border-color: var(--warn-line) !important;
  box-shadow: 0 0 0 4px rgba(242,208,123,0.28) !important;
}

.amount{
  display: grid;
  gap: 14px;
}

.amount__row{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
}
.amount__label{
  color: #344054;
  font-weight: 700;
}

.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chip{
  height: 44px;
  min-width: 54px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f2f4f7;
  font-size: 16px;
  font-weight: 700;
  color: #101828;
  cursor: pointer;
  touch-action: manipulation;
}
.chip:focus{ outline: none; box-shadow: var(--focus); }
.chip--active{
  background: rgba(47,111,237,0.12);
  border-color: rgba(47,111,237,0.40);
}
.chip--muted{ color: #475467; }

.chip-input{
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-size: 16px;
  width: min(240px, 100%);
}
.chip-input:focus{
  outline: none;
  border-color: rgba(47,111,237,0.55);
  box-shadow: var(--focus);
}

.amount__row--bottom{
  margin-top: 6px;
  grid-template-columns: 1fr 2fr;
  align-items: end;
  justify-content: flex-start;

}
.total{
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-left: 12px;
}
.total__value{
  font-weight: 900;
  font-size: 22px;
  color: var(--accent-2);
}

.checks{
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.check{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
  color: #344054;
}
.check input{
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
}

.actions{
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  padding-top: 6px;
}

.btn{
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(47,111,237,0.25);
  background: var(--accent-2);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: var(--shadow-soft);
}
.btn:focus{ outline: none; box-shadow: var(--focus); }
.btn:hover{ filter: brightness(0.98); }

.btn--ghost{
  background: #fff;
  color: #1d4ed8;
  border-color: rgba(47,111,237,0.28);
}

.yearly-display{
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: #101828;
}
.yearly-display__value{
  font-weight: 900;
}

.amount__row--compact{
  grid-template-columns: 120px auto;
  align-items: center;
}

.yearly-display--compact{
  width: fit-content;
  min-width: 120px;
  justify-content: center;
  padding: 0 18px;
  white-space: nowrap;
}

/* Avatar & signature tweaks used by summary.html */
#avatar { background: #fff; }
#avatar img{ width:100%; height:100%; object-fit:cover }
#sigPreview img{ max-width:100%; max-height:160px; display:block }



@media (max-width: 860px){
  .hero__brand{
    grid-template-columns: 1fr;
    text-align: center;
  }
  .logo{ justify-content: center; }
  .card__row{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px){
  .grid{ grid-template-columns: 1fr; }
  .span-2{ grid-column: auto; }
  .amount__row{ grid-template-columns: 1fr; }
  .amount__row--bottom{ grid-template-columns: 1fr; }
  .actions{ justify-content: stretch; }
  .btn{ width: 100%; }
}

/* Better tap behavior on iPad */
@supports (-webkit-touch-callout: none) {
  input, select, button { -webkit-tap-highlight-color: transparent; }
}
