/* ==========================================================================
   Accounts, member dashboard, plans, donations, payment pages.
   Builds on site.css (kg-btn, kg-field, kg-input, kg-table, kg-badge ...).
   Logical properties only, so Sorani (RTL) mirrors automatically.
   ========================================================================== */

/* ---------- auth pages (login / register / reset) — same look as the old theme ---------- */
.kg-auth {
  background: linear-gradient(135deg, #003366, #1A4B7D);
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  padding: 4rem 1rem; position: relative; overflow: hidden;
}
.kg-auth::before {
  content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background: radial-gradient(circle at 75% 25%, #14B1BB, transparent 55%);
}
.kg-auth__inner { width: 100%; max-width: 480px; position: relative; z-index: 1; }
.kg-auth__inner--wide { max-width: 640px; }
.kg-auth__brand { text-align: center; margin-bottom: 1.75rem; }
.kg-auth__brand a { font-size: 2rem; font-weight: 900; color: #fff; letter-spacing: -.02em; text-decoration: none; }
.kg-auth__brand p { color: rgba(255,255,255,.7); font-size: .9rem; margin: .5rem 0 0; }
.kg-auth__card {
  background: #fff; border-radius: 2rem; padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0,51,102,.18); border: 1px solid #f1f5f9;
}
.kg-auth__icon {
  width: 4rem; height: 4rem; border-radius: 50%; margin: 0 auto 1rem;
  background: linear-gradient(135deg, #003366, #14B1BB); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.kg-auth__card h1, .kg-auth__card h2 { color: #003366; margin: 0 0 .35rem; font-size: 1.5rem; }
.kg-auth__lead { color: #64748b; margin: 0 0 1.75rem; font-size: .9rem; line-height: 1.6; }
.kg-auth__foot { text-align: center; margin-top: 1.25rem; font-size: .85rem; color: #64748b; }
.kg-auth__foot a, .kg-link { color: #0E7C83; font-weight: 700; text-decoration: none; }
.kg-auth__foot a:hover, .kg-link:hover { text-decoration: underline; }
.kg-auth__copy { text-align: center; margin-top: 1.5rem; font-size: .8rem; color: rgba(255,255,255,.45); }
.kg-auth .kg-flashes { margin: 0 0 1rem; padding: 0; }
.kg-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.kg-label-row a { font-size: .78rem; color: #0E7C83; font-weight: 600; text-decoration: none; }
.kg-btn--block { width: 100%; }
.kg-btn--lg { padding: 1rem 1.6rem; font-size: 1rem; }
.kg-hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* choice tiles (member type, visibility, payment method) */
.kg-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.kg-choice {
  display: flex; align-items: flex-start; gap: .6rem; cursor: pointer;
  background: #f8fafc; padding: .85rem 1rem; border-radius: .9rem; border: 2px solid #e2e8f0;
  font-size: .86rem; transition: border-color .2s, background .2s; color: #334155;
}
.kg-choice:hover { border-color: rgba(20,177,187,.5); }
.kg-choice:has(input:checked) { border-color: #14B1BB; background: rgba(20,177,187,.06); }
.kg-choice input { margin-top: .15rem; accent-color: #14B1BB; flex-shrink: 0; }
.kg-choice strong { color: #003366; display: block; }
.kg-choice small { color: #64748b; display: block; line-height: 1.5; margin-top: .15rem; }
.kg-choices--one { grid-template-columns: 1fr; }
@media (max-width: 560px) { .kg-choices { grid-template-columns: 1fr; } .kg-auth__card { padding: 1.6rem; border-radius: 1.5rem; } }

/* ---------- member area ---------- */
.kg-member-hero {
  background: linear-gradient(135deg, #003366, #0e7c83); color: #fff;
  padding: 3rem 1.25rem 4.5rem; position: relative; overflow: hidden;
}
.kg-member-hero::after { content: ""; position: absolute; inset: 0; opacity: .08; background: radial-gradient(circle at 80% 20%, #14B1BB, transparent 60%); }
.kg-member-hero > div { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.kg-member-hero h1 { color: #fff !important; margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.kg-member-hero p { color: rgba(255,255,255,.8); margin: .3rem 0 0; }
.kg-avatar {
  width: 4.5rem; height: 4.5rem; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: rgba(255,255,255,.15); border: 3px solid rgba(255,255,255,.35);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.6rem; color: #fff;
}
.kg-member { max-width: 1100px; margin: -2.5rem auto 4rem; padding: 0 1.25rem; position: relative; z-index: 2; }
.kg-member-nav {
  display: flex; flex-wrap: wrap; gap: .35rem; background: #fff; border: 1px solid var(--kg-line);
  border-radius: 9999px; padding: .35rem; box-shadow: 0 8px 30px rgba(0,51,102,.08); margin-bottom: 1.75rem;
}
.kg-member-nav a {
  padding: .55rem 1.1rem; border-radius: 9999px; font-size: .88rem; font-weight: 700;
  color: #475569; text-decoration: none; transition: background .2s, color .2s;
}
.kg-member-nav a:hover { background: #f1f5f9; color: #003366; }
.kg-member-nav a.is-active { background: #003366; color: #fff; }
.kg-member-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .kg-member-grid { grid-template-columns: 1fr; } .kg-member-nav { border-radius: 1.25rem; } }
.kg-panel { background: #fff; border: 1px solid var(--kg-line); border-radius: 1.5rem; padding: 1.6rem; box-shadow: 0 4px 20px rgba(0,0,0,.04); }
.kg-panel + .kg-panel { margin-top: 1.5rem; }
.kg-panel h2 { font-size: 1.1rem; color: #003366; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }
.kg-panel h2 .material-symbols-outlined { color: #14B1BB; font-size: 1.3rem; }
.kg-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.kg-panel__head h2 { margin: 0; }
.kg-membership-card {
  border-radius: 1.25rem; padding: 1.5rem; color: #fff;
  background: linear-gradient(135deg, #003366, #14B1BB); position: relative; overflow: hidden;
}
.kg-membership-card::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); inset-inline-end: -60px; top: -80px; }
.kg-membership-card .plan { font-size: 1.3rem; font-weight: 800; margin: .35rem 0; color: #fff; }
.kg-membership-card .muted { color: rgba(255,255,255,.8); font-size: .88rem; }
.kg-membership-card .kg-badge { background: rgba(255,255,255,.2); color: #fff; }
.kg-membership-card--free { background: linear-gradient(135deg, #475569, #64748b); }
.kg-membership-card--warn { background: linear-gradient(135deg, #92400e, #d97706); }
.kg-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.kg-actions .kg-btn--light { background: #fff; color: #003366; }
.kg-actions .kg-btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.kg-progress { height: .55rem; background: #e2e8f0; border-radius: 9999px; overflow: hidden; margin: .6rem 0 .4rem; }
.kg-progress > span { display: block; height: 100%; background: linear-gradient(90deg, #14B1BB, #003366); border-radius: inherit; }
.kg-quick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.kg-quick a {
  display: flex; align-items: center; gap: .55rem; padding: .85rem 1rem; border-radius: 1rem;
  background: #f8fafc; border: 1px solid #f1f5f9; color: #003366; font-weight: 700; font-size: .88rem; text-decoration: none;
  transition: border-color .2s, background .2s;
}
.kg-quick a:hover { border-color: rgba(20,177,187,.4); background: rgba(224,247,248,.5); }
.kg-quick .material-symbols-outlined { color: #14B1BB; }
.kg-note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 1rem; padding: .9rem 1.1rem; font-size: .88rem; line-height: 1.6; }
.kg-note--info { background: var(--kg-teal-light); border-color: rgba(20,177,187,.3); color: #003366; }
.kg-avatar-edit { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.kg-avatar-edit .kg-avatar { background: #e2e8f0; color: #003366; border-color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* ---------- plans ---------- */
.kg-plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.75rem; max-width: 1200px; margin: 0 auto; }
.kg-plan {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 1.5rem; padding: 2rem 1.6rem;
  display: flex; flex-direction: column; position: relative; transition: transform .25s, box-shadow .25s;
}
.kg-plan:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,.1); }
.kg-plan--popular { border: 2px solid var(--plan-color, #003366); box-shadow: 0 14px 35px rgba(0,51,102,.12); }
.kg-plan__ribbon {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: linear-gradient(135deg, var(--plan-color, #003366), #14B1BB); color: #fff;
  padding: .4rem 1.25rem; border-radius: 9999px; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.kg-plan__current { position: absolute; top: 1rem; inset-inline-end: 1rem; background: #dcfce7; color: #166534; padding: .25rem .65rem; border-radius: 9999px; font-size: .7rem; font-weight: 700; }
.kg-plan__head { text-align: center; padding-bottom: 1.5rem; border-bottom: 1px solid #f1f5f9; }
.kg-plan__icon {
  display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(145deg, color-mix(in srgb, var(--plan-color, #003366) 12%, #fff), #fff);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--plan-color, #003366) 14%, transparent), inset 0 0 0 1.5px color-mix(in srgb, var(--plan-color, #003366) 18%, transparent);
  font-size: 2.1rem; margin-bottom: 1rem;
}
.kg-plan__name { margin: 0 0 1rem; color: var(--plan-color, #003366); font-size: 1.3rem; font-weight: 800; line-height: 1.35; }
.kg-plan__from { display: block; font-size: .7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: .35rem; }
.kg-plan__price { display: inline-flex; align-items: baseline; gap: .18rem; line-height: 1; }
.kg-plan__price .cur { font-size: 1.4rem; font-weight: 800; color: var(--plan-color, #003366); align-self: flex-start; margin-top: .5rem; }
.kg-plan__price .num { font-size: 3.1rem; font-weight: 900; color: #0f172a; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kg-plan__price .per { color: #64748b; font-size: .92rem; font-weight: 600; margin-inline-start: .2rem; }
.kg-plan__pill { display: inline-flex; align-items: center; gap: .45rem; margin-top: .9rem; background: #f1f5f9; color: #475569; padding: .3rem .8rem; border-radius: 9999px; font-size: .76rem; font-weight: 600; border: 1px solid #e2e8f0; }
.kg-plan__pill b { background: var(--plan-color, #003366); color: #fff; padding: .15rem .55rem; border-radius: 9999px; font-size: .66rem; letter-spacing: .08em; }
.kg-plan__free { display: inline-block; background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #15803d; padding: .55rem 1.4rem; border-radius: 9999px; font-size: 1.7rem; font-weight: 900; }
.kg-plan__elected { display: inline-block; color: var(--plan-color, #003366); padding: .55rem 1.2rem; border-radius: 9999px; font-weight: 800; border: 1.5px dashed currentColor; }
.kg-plan__sub { margin: .8rem 0 0; color: #94a3b8; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.kg-plan__features { list-style: none; margin: 1.5rem 0; padding: 0; flex: 1; }
.kg-plan__features li { display: flex; align-items: flex-start; gap: .65rem; padding: .45rem 0; color: #334155; font-size: .92rem; line-height: 1.5; }
.kg-plan__features li::before { content: "✓"; color: var(--plan-color, #003366); font-weight: 800; flex-shrink: 0; }
.kg-plan__amount { position: relative; margin-bottom: .9rem; }
.kg-plan__amount label { display: block; font-size: .76rem; color: #64748b; font-weight: 700; margin-bottom: .45rem; text-transform: uppercase; letter-spacing: .05em; }
.kg-plan__amount input { text-align: center; border-radius: 9999px; font-weight: 700; font-size: 1.05rem; }
.kg-plan__amount small { display: block; text-align: center; color: #94a3b8; font-size: .72rem; margin-top: .35rem; }
.kg-plan .kg-btn { width: 100%; margin-bottom: .55rem; }
.kg-plan .kg-btn--plan { background: var(--plan-color, #003366); color: #fff; }
.kg-plan .kg-btn--plan:hover { filter: brightness(1.1); }
.kg-plan .kg-btn--plan-ghost { background: #fff; color: var(--plan-color, #003366); border-color: var(--plan-color, #003366); }
.kg-plan__note { margin: 0; color: #64748b; font-size: .72rem; text-align: center; font-style: italic; }
.kg-trust { display: flex; justify-content: center; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; color: #64748b; font-size: .85rem; }
.kg-faq details { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; margin-bottom: .75rem; overflow: hidden; }
.kg-faq summary { padding: 1rem 1.25rem; font-weight: 700; color: #003366; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.kg-faq summary::-webkit-details-marker { display: none; }
.kg-faq summary::after { content: "+"; color: #14B1BB; font-size: 1.25rem; line-height: 1; }
.kg-faq details[open] summary::after { content: "−"; }
.kg-faq details > div { padding: 0 1.25rem 1rem; color: #64748b; font-size: .9rem; line-height: 1.7; }

/* ---------- donation form ---------- */
.kg-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1.1rem; }
.kg-amount { position: relative; }
.kg-amount input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.kg-amount span {
  display: block; text-align: center; padding: .9rem .5rem; border-radius: 1rem; border: 2px solid #e2e8f0;
  background: #f8fafc; color: #003366; font-weight: 800; font-size: 1.05rem; transition: all .2s;
}
.kg-amount input:checked + span { border-color: #14B1BB; background: rgba(20,177,187,.08); color: #0E7C83; }
.kg-amount input:focus-visible + span { outline: 3px solid #14B1BB; outline-offset: 2px; }
.kg-seg { display: flex; gap: .6rem; flex-wrap: wrap; }
.kg-seg label { flex: 1; min-width: 7rem; position: relative; }
.kg-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.kg-seg span { display: block; text-align: center; padding: .7rem .9rem; border-radius: 9999px; border: 2px solid #e2e8f0; color: #475569; font-weight: 700; font-size: .88rem; transition: all .2s; }
.kg-seg input:checked + span { border-color: #14B1BB; color: #0E7C83; background: rgba(20,177,187,.05); }
.kg-seg input:focus-visible + span { outline: 3px solid #14B1BB; outline-offset: 2px; }
@media (max-width: 560px) { .kg-amounts { grid-template-columns: repeat(2, 1fr); } }

/* ---------- payment status ---------- */
.kg-pay-box { background: #fff; border: 1px solid var(--kg-line); border-radius: 1.75rem; padding: 2rem; box-shadow: 0 10px 40px rgba(0,51,102,.06); }
.kg-pay-icon { width: 4.5rem; height: 4.5rem; border-radius: 50%; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.kg-pay-icon--ok { background: #dcfce7; color: #166534; }
.kg-pay-icon--wait { background: #fef3c7; color: #92400e; }
.kg-pay-icon--bad { background: #fee2e2; color: #991b1b; }
.kg-summary { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .92rem; }
.kg-summary th { text-align: start; color: #64748b; font-weight: 600; padding: .55rem 0; width: 40%; }
.kg-summary td { font-weight: 700; color: #0f172a; padding: .55rem 0; }
.kg-summary tr + tr th, .kg-summary tr + tr td { border-top: 1px solid #f1f5f9; }
.kg-steps { counter-reset: kgstep; list-style: none; padding: 0; margin: 1rem 0; }
.kg-steps li { counter-increment: kgstep; position: relative; padding-inline-start: 2.6rem; margin-bottom: 1.1rem; color: #334155; line-height: 1.6; }
.kg-steps li::before {
  content: counter(kgstep); position: absolute; inset-inline-start: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: #003366; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem;
}
.kg-copy {
  display: flex; align-items: center; gap: .5rem; margin-top: .45rem; background: #f8fafc; border: 1.5px dashed #cbd5e1;
  border-radius: .85rem; padding: .55rem .55rem .55rem .9rem; font-weight: 800; color: #003366; font-size: 1.05rem; word-break: break-all;
}
.kg-copy code { flex: 1; font-family: ui-monospace, Consolas, monospace; background: none; direction: ltr; text-align: start; }
.kg-copy button { flex-shrink: 0; }
