@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&display=swap');

:root{
  --primary:#0f5c4a;
  --primary-dark:#0a4436;
  --gold:#b8894b;
  --bg:#f6f4ef;
  --card:#ffffff;
  --text:#25302c;
  --muted:#6b7570;
  --danger:#b3402f;
  --success:#1e7a4c;
  --border:#e3ddd0;
  --radius:14px;
}

*{box-sizing:border-box;}

body{
  margin:0;
  font-family:'Tajawal', Tahoma, sans-serif;
  background:linear-gradient(180deg,#faf8f3 0%, var(--bg) 100%);
  color:var(--text);
  direction:rtl;
  min-height:100vh;
}

.wrap{
  max-width:820px;
  margin:0 auto;
  padding:28px 18px 60px;
}

header.site-header{
  text-align:center;
  padding:28px 10px 18px;
}

header.site-header .badge{
  display:inline-block;
  width:64px;height:64px;
  border-radius:50%;
  background:var(--primary);
  color:#fff;
  font-size:28px;
  line-height:64px;
  margin-bottom:10px;
}

header.site-header h1{
  margin:0;
  font-size:26px;
  font-weight:900;
  color:var(--primary-dark);
}

header.site-header p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:14px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px 22px 26px;
  margin-bottom:20px;
  box-shadow:0 2px 10px rgba(15,92,74,0.05);
}

.card h2{
  font-size:19px;
  color:var(--primary-dark);
  margin:0 0 4px;
  display:flex;
  align-items:center;
  gap:8px;
}

.section-points{
  font-size:12.5px;
  color:var(--gold);
  font-weight:700;
  background:#fbf1e2;
  padding:2px 10px;
  border-radius:20px;
}

.card .hint{
  color:var(--muted);
  font-size:13px;
  margin:0 0 16px;
}

label.field-label{
  display:block;
  font-weight:700;
  margin-bottom:8px;
  font-size:15px;
}

input[type="text"]{
  width:100%;
  padding:12px 14px;
  border:1.5px solid var(--border);
  border-radius:10px;
  font-family:inherit;
  font-size:15px;
  background:#fff;
}
input[type="text"]:focus{
  outline:none;
  border-color:var(--primary);
}

.question{
  padding:14px 0;
  border-bottom:1px solid var(--border);
}
.question:last-child{border-bottom:none;}

.question p{
  margin:0 0 10px;
  font-weight:500;
  line-height:1.6;
}

.q-num{
  color:var(--gold);
  font-weight:700;
  margin-left:6px;
}

.options{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}

.opt{
  display:flex;
  align-items:center;
  gap:6px;
  background:#f4f6f4;
  border:1.5px solid var(--border);
  padding:8px 16px;
  border-radius:10px;
  cursor:pointer;
  font-size:14px;
  transition:all .15s;
}
.opt:hover{border-color:var(--primary);}
.opt input{accent-color:var(--primary); width:16px; height:16px;}
.opt.checked{
  background:#e8f3ee;
  border-color:var(--primary);
  color:var(--primary-dark);
  font-weight:700;
}

.submit-bar{
  text-align:center;
  margin-top:8px;
}

button.btn, a.btn{
  display:inline-block;
  background:var(--primary);
  color:#fff !important;
  border:none;
  padding:14px 38px;
  font-size:16px;
  font-weight:700;
  border-radius:12px;
  cursor:pointer;
  font-family:inherit;
  text-decoration:none;
  transition:background .15s, transform .1s;
}
button.btn:hover, a.btn:hover{background:var(--primary-dark);}
button.btn:active{transform:scale(0.98);}

.btn.secondary{
  background:#fff;
  color:var(--primary) !important;
  border:1.5px solid var(--primary);
}
.btn.secondary:hover{background:#f0f7f4;}

.alert{
  padding:14px 18px;
  border-radius:10px;
  font-size:14px;
  margin-bottom:18px;
  line-height:1.7;
}
.alert.error{background:#fbe9e6; color:var(--danger); border:1px solid #f2c9c1;}
.alert.info{background:#eaf2ff; color:#1a4e8a; border:1px solid #c9dcf7;}
.alert.success{background:#e8f6ee; color:var(--success); border:1px solid #bfe6cf;}

.progress-summary{
  text-align:center;
  padding:26px 10px 6px;
}
.progress-summary .pct{
  font-size:52px;
  font-weight:900;
  color:var(--primary-dark);
}
.progress-summary .pct.fail{color:var(--danger);}
.progress-summary .status{
  font-size:18px;
  font-weight:700;
  margin-top:4px;
}
.progress-bar{
  height:14px;
  background:#eee;
  border-radius:20px;
  overflow:hidden;
  margin:16px 0;
}
.progress-bar > div{
  height:100%;
  background:linear-gradient(90deg, var(--primary), #2a9d76);
  border-radius:20px;
}

footer.site-footer{
  text-align:center;
  color:var(--muted);
  font-size:12.5px;
  padding:20px 0 40px;
}

/* شهادة التخرج */
.cert-wrap{
  max-width:950px;
  margin:0 auto;
  padding:24px 16px;
}
.cert{
  background:#fffdf8;
  border:10px double var(--gold);
  border-radius:6px;
  padding:50px 55px;
  text-align:center;
  position:relative;
}
.cert .bismillah{
  font-size:15px;
  color:var(--muted);
  margin-bottom:6px;
}
.cert .ayah{
  font-size:16px;
  color:var(--primary-dark);
  margin-bottom:22px;
  font-weight:700;
}
.cert h1.cert-title{
  font-size:34px;
  color:var(--primary-dark);
  margin:0 0 26px;
  font-weight:900;
  letter-spacing:1px;
}
.cert .cert-body{
  font-size:16.5px;
  line-height:2.1;
  color:var(--text);
  text-align:justify;
}
.cert .student-name{
  display:inline-block;
  font-size:24px;
  font-weight:900;
  color:var(--primary);
  border-bottom:2px solid var(--gold);
  padding:2px 22px;
  margin:6px 4px;
}
.cert .signature-row{
  display:flex;
  justify-content:space-between;
  margin-top:46px;
  font-size:14px;
  color:var(--muted);
}
.cert .seal{
  margin-top:18px;
  font-size:13px;
  color:var(--muted);
}
.no-print{margin-top:26px; text-align:center;}

@media print{
  body{background:#fff;}
  .no-print, header.site-header, footer.site-footer{display:none !important;}
  .cert-wrap{padding:0; max-width:100%;}
  .cert{border-width:6px double var(--gold); box-shadow:none;}
}

@media (max-width:600px){
  .cert{padding:30px 20px;}
  .cert h1.cert-title{font-size:24px;}
  .cert .student-name{font-size:19px;}
  .progress-summary .pct{font-size:40px;}
}
