/* =============================================
   NASAB — Islamic Genealogy Helper
   Muslim Life Hub
============================================= */
:root {
  --green-deep:  #1A3A2A;
  --green-mid:   #2D5A3D;
  --green-light: #EAF3ED;
  --gold:        #C9973A;
  --gold-light:  #E8C97A;
  --gold-pale:   #FDF6E8;
  --cream:       #FAF8F3;
  --white:       #FFFFFF;
  --text:        #1C1C1C;
  --text-mid:    #4B5563;
  --text-muted:  #9CA3AF;
  --border:      #E5DDD0;
  --radius:      12px;
  --sky:         #0A0F1E;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--cream); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--green-mid); text-decoration: none; }

/* ---- HEADER ---- */
.site-header {
  background: var(--green-deep);
  border-bottom: 3px solid var(--gold);
  padding: 1rem 1.5rem;
}
.header-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; }
.header-back { font-size: 0.78rem; color: rgba(232,201,122,0.6); }
.header-back:hover { color: var(--gold); }
.header-brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-moon { font-size: 1.5rem; color: var(--gold); filter: drop-shadow(0 0 6px rgba(201,151,58,0.4)); }
.brand-name { font-family: 'Amiri', serif; font-size: 1.3rem; color: #fff; line-height: 1; }
.brand-tagline { font-size: 0.65rem; color: var(--gold-light); opacity: 0.7; }

/* ---- LANDING HERO ---- */
.landing-hero {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  padding: 3.5rem 1.5rem;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}
.hero-inner { max-width: 620px; margin: 0 auto; }
.hero-bismillah { font-family: 'Amiri', serif; font-size: 1.75rem; color: var(--gold); margin-bottom: 0.75rem; }
.hero-title { font-family: 'Amiri', serif; font-size: clamp(2rem,5vw,3rem); color: #fff; margin-bottom: 0.6rem; line-height: 1.2; }
.hero-sub { font-size: 0.9rem; color: rgba(255,255,255,0.75); line-height: 1.7; margin-bottom: 1.5rem; }
.hero-sub em { color: var(--gold-light); font-style: normal; }
.hero-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.hero-feature { background: rgba(255,255,255,0.08); border: 1px solid rgba(201,151,58,0.25); border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.75rem; color: rgba(255,255,255,0.8); }

/* ---- LANDING CARDS ---- */
.landing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 900px; margin: 2.5rem auto; padding: 0 1.5rem; }
.landing-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
.landing-card.primary { border-top: 4px solid var(--gold); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card-title { font-family: 'Amiri', serif; font-size: 1.3rem; color: var(--green-deep); margin-bottom: 0.4rem; }
.card-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.25rem; }
.card-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.75rem; line-height: 1.5; }
.card-hint code { background: var(--cream); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.68rem; }

/* ---- HOW IT WORKS ---- */
.how-it-works { max-width: 900px; margin: 0 auto 3rem; padding: 0 1.5rem; }
.how-title { font-family: 'Amiri', serif; font-size: 1.5rem; color: var(--green-deep); text-align: center; margin-bottom: 1.5rem; }
.how-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.how-step { text-align: center; }
.step-num { font-family: 'Amiri', serif; font-size: 2rem; color: var(--gold); line-height: 1; margin-bottom: 0.5rem; }
.step-title { font-weight: 600; font-size: 0.85rem; color: var(--green-deep); margin-bottom: 0.25rem; }
.step-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* ---- FORM ELEMENTS ---- */
.create-form { display: flex; flex-direction: column; gap: 0; }
.form-group { margin-bottom: 0.85rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.form-label .req { color: var(--gold); margin-left: 2px; }
.form-control { width: 100%; background: var(--white); border: 1.5px solid var(--border); border-radius: 8px; padding: 0.55rem 0.85rem; font-size: 0.88rem; font-family: 'Inter', sans-serif; color: var(--text); outline: none; transition: border-color 0.14s; }
.form-control:focus { border-color: var(--gold); }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.6; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; cursor: pointer; }
.form-section-title { font-family: 'Amiri', serif; font-size: 1rem; color: var(--green-deep); margin-bottom: 0.85rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }

/* ---- BUTTONS ---- */
.btn-primary { width: 100%; background: var(--gold); color: var(--green-deep); border: none; padding: 0.75rem; border-radius: 8px; font-size: 0.92rem; font-weight: 700; font-family: 'Inter', sans-serif; cursor: pointer; margin-top: 0.5rem; transition: opacity 0.14s; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { width: 100%; background: var(--green-deep); color: #fff; border: none; padding: 0.75rem; border-radius: 8px; font-size: 0.92rem; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer; margin-top: 0.5rem; transition: opacity 0.14s; }
.btn-secondary:hover { opacity: 0.88; }
.btn-primary-sm { background: var(--gold); color: var(--green-deep); border: none; padding: 0.5rem 1.25rem; border-radius: 8px; font-size: 0.85rem; font-weight: 700; font-family: 'Inter', sans-serif; cursor: pointer; }
.btn-outline-sm { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 0.5rem 1.1rem; border-radius: 8px; font-size: 0.85rem; font-family: 'Inter', sans-serif; cursor: pointer; }
.btn-danger-sm { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; padding: 0.4rem 0.9rem; border-radius: 8px; font-size: 0.78rem; font-family: 'Inter', sans-serif; cursor: pointer; }

/* ---- MODAL ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--white); border-radius: var(--radius); width: 100%; position: relative; max-height: 90vh; display: flex; flex-direction: column; }
.modal-box.large { max-width: 580px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-family: 'Amiri', serif; font-size: 1.2rem; color: var(--green-deep); }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); padding: 0.2rem 0.5rem; }
.modal-body { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-top: 1px solid var(--border); gap: 0.5rem; flex-shrink: 0; }
.modal-footer-right { display: flex; gap: 0.5rem; }

/* ---- SHARE ---- */
.share-link-box { display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 0.75rem; }
.share-link-input { flex: 1; border: none; padding: 0.6rem 0.85rem; font-size: 0.78rem; font-family: 'Inter', sans-serif; outline: none; color: var(--text-mid); background: var(--cream); }
.share-copy-btn { background: var(--green-deep); color: #fff; border: none; padding: 0.6rem 1rem; font-size: 0.78rem; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer; }
.btn-whatsapp { display: inline-block; background: #25D366; color: #fff; padding: 0.6rem 1.5rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; margin-top: 0.5rem; }

/* ---- FOOTER ---- */
.site-footer { background: var(--green-deep); border-top: 2px solid var(--gold); padding: 1.25rem 1rem; text-align: center; margin-top: auto; font-size: 0.75rem; color: rgba(232,201,122,0.5); }
.site-footer a { color: var(--gold); opacity: 0.7; }

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
  .landing-cards { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .how-steps { grid-template-columns: 1fr; }
}
