
:root{
  --uok-blue:#001a45;
  --uok-blue-2:#00357f;
  --uok-gold:#d9a441;
  --uok-bg:#f4f7fb;
  --uok-border:#d7e1ee;
  --uok-danger:#b42318;
  --uok-text:#172033;
  --shadow:0 18px 45px rgba(0,26,69,.12);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:'Almarai',Arial,sans-serif;
  background:linear-gradient(180deg,#eef4fb,#fff);
  color:var(--uok-text);
  direction:rtl;
}
button,input,select{font:inherit}
.page-shell{max-width:1380px;margin:auto;padding:28px 22px 56px}
.screen-hero{
  border-radius:28px;
  background:linear-gradient(135deg,var(--uok-blue),var(--uok-blue-2));
  color:#fff;
  padding:32px 28px;
  box-shadow:var(--shadow);
}
.version-badge{display:inline-block;padding:7px 13px;border-radius:999px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);font-weight:800;font-size:13px}
.screen-hero h1{margin:14px 0 8px;font-size:clamp(26px,4vw,44px);line-height:1.35}
.screen-hero p{margin:0;color:rgba(255,255,255,.86);line-height:1.9}
.form-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr);gap:20px;margin-top:22px;align-items:start}
.screen-card{background:#fff;border:1px solid var(--uok-border);border-radius:22px;box-shadow:var(--shadow);overflow:hidden}
.screen-card-head{padding:20px 22px;border-bottom:1px solid var(--uok-border);background:linear-gradient(180deg,#fff,#f8fbff)}
.screen-card-head h2,.instructions h2{margin:0 0 8px;color:var(--uok-blue)}
.screen-card-head p{margin:0;color:#667085}
.screen-form{padding:22px}
.fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.field-full{grid-column:1/-1}
.field label{display:block;font-size:14px;font-weight:800;margin-bottom:8px}
.field label.required::after{content:" *";color:var(--danger,#b42318)}
.field input,.field select{width:100%;border:1px solid var(--uok-border);border-radius:14px;padding:12px 13px;background:#fff;outline:none}
.field input:focus,.field select:focus{border-color:var(--uok-blue-2);box-shadow:0 0 0 4px rgba(0,53,127,.09)}
.field small{display:block;margin-top:7px;color:#667085}
.photo-input-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.photo-input-actions input[type="file"]{
  flex:1 1 360px;
}
.btn-remove-photo{
  flex:0 0 auto;
  background:#fff1f0;
  color:var(--uok-danger);
  border:1px solid #ffd4cf;
  padding:11px 16px;
}
.btn-remove-photo:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.btn-remove-photo:not(:disabled):hover{
  background:#ffe8e5;
}
.email-box{display:flex;direction:ltr;border:1px solid var(--uok-border);border-radius:14px;overflow:hidden}
.email-box input{border:0!important;box-shadow:none!important;border-radius:0}
.email-box span{padding:12px 13px;background:#f4f7fb;color:var(--uok-blue);font-weight:800;border-right:1px solid var(--uok-border)}
.form-options{display:grid;gap:10px;margin-top:18px;padding:14px;background:#f8fbff;border:1px dashed var(--uok-border);border-radius:16px}
.form-options label{display:flex;align-items:center;gap:10px;font-weight:700}
.form-options input{width:auto}
.form-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}
.btn{border:0;border-radius:14px;padding:13px 18px;font-weight:800;cursor:pointer}
.btn-primary{background:var(--uok-gold);color:#111827}
.btn-secondary{background:#eef4fb;color:var(--uok-blue);border:1px solid var(--uok-border)}
.btn-danger{background:#fff1f0;color:var(--uok-danger);border:1px solid #ffd4cf}
.instructions{padding:22px}
.instructions ol{margin:14px 0 0;padding-right:22px;line-height:2}
.security-note{margin-top:18px;border-radius:16px;border:1px solid rgba(15,138,75,.2);background:#f1fbf5;padding:15px;color:#14532d;font-weight:700;line-height:1.8}
.preview-wrap{display:none;margin-top:22px}
.preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:#fff;border:1px solid var(--uok-border);border-radius:18px;box-shadow:var(--shadow);padding:15px 16px;margin-bottom:14px}
.preview-toolbar strong{color:var(--uok-blue)}
.preview-toolbar div{display:flex;gap:10px;flex-wrap:wrap}

/* PRINT DOCUMENT */
.document-page{
  width:210mm;
  height:297mm;
  margin:0 auto;
  background:#fff;
  border:1.2pt solid var(--uok-blue);
  border-radius:2.5mm;
  box-shadow:0 18px 50px rgba(0,0,0,.08);
  padding:6mm;
  overflow:hidden;
  color:#000;
}
.document-inner{
  height:285mm;
  display:grid;
  grid-template-rows:52mm 12mm 7mm 101mm 22mm 31mm 43mm 7mm;
  gap:1.4mm;
}
.document-header{
  display:grid;
  grid-template-columns:1fr 42mm 1fr 31mm;
  align-items:center;
  column-gap:6mm;
  direction:rtl;
}
.ministry-block{
  grid-column:1;
  text-align:center;
  font-weight:800;
  font-size:14.2pt;
  line-height:1.65;
  color:var(--uok-blue);
}
.logo-block{
  grid-column:2;
  text-align:center;
}
.logo-block img{width:38mm;height:auto;display:block;margin:auto}
.center-block{
  grid-column:3;
  text-align:center;
  font-weight:800;
  font-size:13.5pt;
  line-height:1.65;
}
.photo-block{
  grid-column:4;
  width:29mm;
  height:39mm;
  border:1pt solid var(--uok-blue);
  border-radius:1.8mm;
  overflow:hidden;
  display:flex;
  justify-content:center;
  align-items:center;
  text-align:center;
  font-size:9.6pt;
  font-weight:800;
  line-height:1.55;
  background:#fff;
}
.photo-block>span{display:flex;flex-direction:column;align-items:center;gap:1mm}
.photo-placeholder{width:19mm;height:23mm;object-fit:contain}
#photoPreview{width:100%;height:100%;object-fit:cover;display:none}
.header-rule{
  grid-column:1/5;
  align-self:end;
  position:relative;
  height:3mm;
}
.header-rule::before,.header-rule::after{
  content:"";
  position:absolute;
  top:1.2mm;
  width:46%;
  border-top:1.7pt solid var(--uok-blue);
}
.header-rule::before{right:0}
.header-rule::after{left:0}
.header-rule span{
  position:absolute;
  left:50%;
  top:.3mm;
  transform:translateX(-50%);
  width:2.4mm;
  height:2.4mm;
  border-radius:50%;
  background:var(--uok-blue);
  box-shadow:-4mm 0 0 var(--uok-gold),4mm 0 0 var(--uok-gold);
}
.document-title{
  margin:0;
  display:flex;
  justify-content:center;
  align-items:center;
  text-align:center;
  font-size:15.5pt;
  line-height:1.25;
  color:var(--uok-blue);
  font-weight:800;
}
.form-number{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:1.5mm;
  padding-right:2mm;
  font-size:10.6pt;
  font-weight:700;
}
.data-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  border:1pt solid #222;
  border-radius:2mm;
  overflow:hidden;
}
.data-table td{
  height:8.75mm;
  padding:1.7mm 2.6mm;
  vertical-align:middle;
  border-bottom:1pt solid #555;
  border-left:1pt solid #555;
  font-size:11pt;
  line-height:1.2;
}
.data-table tr:last-child td{border-bottom:0}
.data-table td:last-child{border-left:0}
.label-cell{
  width:34%;
  text-align:right;
  font-weight:800;
  color:#111;
  background:#edf4fd;
}
.value-cell{
  width:66%;
  text-align:center;
  font-weight:700;
  background:#fff;
}
.ltr{direction:ltr;text-align:center!important;font-family:Arial,'Times New Roman',serif}
.pledge-box{
  border:1pt dotted var(--uok-blue-2);
  border-radius:2.2mm;
  padding:3mm 5mm;
  font-size:10.8pt;
  font-weight:700;
  line-height:1.7;
  text-align:justify;
  display:flex;
  align-items:center;
  position:relative;
}
.pledge-box::before,.pledge-box::after{
  position:absolute;
  color:var(--uok-blue-2);
  font-size:23pt;
  font-weight:800;
  line-height:1;
}
.pledge-box::before{content:"”";right:2mm;top:-1mm}
.pledge-box::after{content:"“";left:2mm;bottom:-4mm}
.student-signature{
  display:grid;
  grid-template-columns:58mm 1fr;
  border:1pt solid var(--uok-blue-2);
  border-radius:2mm;
  overflow:hidden;
}
.student-data{
  padding:3.5mm 4mm;
  border-left:1pt solid #777;
  font-size:10pt;
  font-weight:700;
  line-height:1.65;
}
.student-data h3{margin:0 0 1mm;color:var(--uok-blue-2);font-size:12pt}
.student-data p{margin:0}
.signature-area{
  padding:4mm 6mm;
  display:flex;
  align-items:center;
  gap:4mm;
  font-size:11pt;
  font-weight:800;
}
.signature-area i{flex:1;border-bottom:1pt dotted #222;height:1mm}
.approval-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  border:1pt solid var(--uok-blue-2);
  border-radius:2mm;
  overflow:hidden;
}
.approval-card{
  padding:2.5mm 4mm 2mm;
  border-left:1pt solid #777;
  display:grid;
  grid-template-rows:9mm 10mm 8mm 8mm;
  gap:1mm;
}
.approval-card:last-child{border-left:0}
.approval-title{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:2.5mm;
  color:var(--uok-blue-2);
  font-size:11.5pt;
  font-weight:800;
}
.approval-title img{width:8mm;height:8mm}
.name-line{border-bottom:1pt dotted #222;align-self:center}
.approval-row{display:flex;align-items:center;gap:2mm;font-size:10.6pt;font-weight:700}
.approval-row i{flex:1;border-bottom:1pt dotted #222;height:1mm}
.document-footer{
  border-top:1.5pt solid var(--uok-blue);
  text-align:center;
  padding-top:1.6mm;
  font-size:8pt;
  line-height:1.3;
}
@media(max-width:900px){
  .page-shell{padding:18px 10px 40px}
  .form-layout{grid-template-columns:1fr}
  .fields-grid{grid-template-columns:1fr}
  .document-page{width:100%;height:auto;min-height:297mm;transform-origin:top center}
}
@media print{
  @page{size:A4 portrait;margin:0}
  html,body{
    width:210mm;
    height:297mm;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
  }
  *{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }
  body *{visibility:hidden!important}
  .document-page,.document-page *{visibility:visible!important}
  .screen-hero,.form-layout,.preview-toolbar{display:none!important}
  .preview-wrap{display:block!important;margin:0!important}
  .page-shell{margin:0!important;padding:0!important;max-width:none!important}
  .document-page{
    position:absolute;
    inset:0;
    width:210mm!important;
    height:297mm!important;
    margin:0!important;
    border:1.2pt solid var(--uok-blue)!important;
    box-shadow:none!important;
    border-radius:0!important;
    padding:6mm!important;
  }
}
