/* Al Badr 2026 redesign: award application (resources/views/frontend/award/v2/apply.blade.php).
   Loaded after albdr.css, pages.css (night-sky hero) and award.css (category cards, rule blocks, prizes).
   The three steps are marked by moons that grow from crescent to full; the last one is البدر. */

/* ---------- hero ---------- */
.ap-hero .page-hero-body{padding-bottom:140px}
.ap-facts{margin:28px 0 0;max-width:420px}

/* ---------- the cream sheet that holds the steps ---------- */
.ap-sheet{position:relative;z-index:3;margin-top:-44px;border-radius:44px 44px 0 0;background:var(--sheet) url("../img/motif-tile-beige.svg") repeat;background-size:86px 110px;color:var(--black);padding:72px 0 110px}

/* stepper: three moons joined by a line that turns green as the steps are done */
.ap-steps{display:flex;list-style:none;margin:0 auto 52px;padding:0;max-width:780px}
.ap-stepper-item{position:relative;flex:1 1 0;display:flex;justify-content:center}
.ap-stepper-item+.ap-stepper-item::before{content:"";position:absolute;top:27px;inset-inline-end:calc(50% + 40px);width:calc(100% - 80px);height:2px;border-radius:2px;background:rgba(4,87,73,.16);transition:background .3s}
.ap-stepper-item.is-done+.ap-stepper-item::before,.ap-stepper-item.is-done+.ap-stepper-item.is-active::before{background:var(--green)}
.ap-mark{display:flex;flex-direction:column;align-items:center;gap:10px;padding:0;border:0;background:none;font:inherit;color:inherit;text-align:center;cursor:default}
.ap-mark:not([disabled]){cursor:pointer}
.ap-mark:focus-visible{outline:2px solid var(--green-deep);outline-offset:4px;border-radius:14px}
.ap-moon{display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:var(--white);border:1.5px solid rgba(4,87,73,.22);color:rgba(4,87,73,.35);transition:background .3s,color .3s,box-shadow .3s,border-color .3s}
.ap-moon svg,.ap-guest-moon svg,.ap-done-moon svg{display:block;fill:currentColor}
.ap-moon .disc,.ap-guest-moon .disc,.ap-done-moon .disc{opacity:.2}
.ap-mark-text{display:flex;flex-direction:column;font-size:15px;font-weight:600;line-height:1.5;color:#616566}
.ap-mark-text small{font-size:12px;font-weight:400}
.is-active .ap-moon{background:#0D3A2D;border-color:#0D3A2D;color:#E5DC5F;box-shadow:0 0 0 6px rgba(233,218,122,.35),0 12px 26px -12px rgba(4,87,73,.8)}
.is-active .ap-mark-text{color:var(--green-deep)}
.is-done .ap-moon{background:var(--green);border-color:var(--green);color:var(--white)}
.is-done .ap-mark-text{color:var(--green-deep)}
.is-done .ap-mark:hover .ap-moon{background:var(--green-deep)}

/* step headings */
.ap-step-head{max-width:680px;margin:0 auto 34px;text-align:center}
.ap-step-head h2,.ap-form h2,.ap-done h2,.ap-guest h2{margin:0;font-size:clamp(24px,2.6vw,32px);line-height:1.4;font-weight:700;color:var(--green-deep)}
.ap-step-head p{margin:10px 0 0;font-size:16px;color:#4d5253}
[tabindex="-1"]:focus{outline:none}

.ap-type{display:flex;flex-direction:column;gap:8px;max-width:420px;margin:0 auto 28px}
.ap-type label{font-size:14px;font-weight:600}
.ap-select{height:52px;padding:0 16px;border:1px solid #848383;border-radius:14px;background:var(--white);font:inherit;font-size:15px;color:var(--black)}
.ap-select:focus-visible{outline:2px solid var(--green-deep);outline-offset:2px}
.ap-status{margin:0 auto 24px;max-width:560px;padding:14px 18px;border-radius:16px;background:rgba(255,255,255,.7);text-align:center;color:#4d5253}
.ap-status.is-empty{background:#FDECEA;color:#7A1A14}

/* step 1: the award page's cards, picked like radio buttons */
.ap-cats{margin-bottom:0;grid-template-columns:repeat(var(--cols,3),minmax(0,390px));justify-content:center}
.ap-cats .cat-tab{min-height:230px}
.ap-cats .cat-tab[aria-checked="true"]{box-shadow:0 0 0 4px var(--sheet),0 0 0 6px var(--green),0 26px 50px -28px rgba(4,87,73,.7)}
.ap-cats .cat-tab[aria-checked="true"] .cat-ic{background:#E5DC5F;border-color:#E5DC5F;color:#0D3A2D}
.ap-cats .cat-tab[aria-checked="true"] .cat-tick{opacity:1;transform:none}
.ap-cats .cat-tab[aria-checked="true"] .cat-shot{filter:blur(.8px) saturate(1.05) brightness(1.05)}
.ap-cats .cat-tab[aria-checked="true"] .cat-media::after{opacity:.35}
.ap-fmt{position:relative;z-index:1;margin-top:auto;display:inline-flex;align-items:center;padding:3px 12px;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(229,220,95,.35);font-size:12.5px;line-height:1.7;color:#E5DC5F}
.ap-cats .cat-tab .top{margin-bottom:14px}

.ap-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:30px}
.ap-step>.ap-actions,.ap-actions.is-center{justify-content:center}
.btn[disabled]{opacity:.75;cursor:progress;transform:none}
#apSubmit[aria-busy="true"]::before{content:"";width:18px;height:18px;border-radius:50%;border:2px solid rgba(255,255,255,.4);border-top-color:var(--white);animation:ap-spin .8s linear infinite}
@keyframes ap-spin{to{transform:rotate(360deg)}}

/* step 2: the award page's panel, with the two buttons under the prizes */
.ap-rules .cp-side .btn-outline{background:transparent}

/* ---------- step 3, done and guest: a white card ---------- */
.ap-card{max-width:760px;margin:0 auto;padding:44px;border-radius:32px;background:var(--white);box-shadow:0 30px 70px -40px rgba(4,87,73,.45);line-height:1.6}
.ap-card :focus-visible{outline:2px solid var(--green-deep);outline-offset:2px}
.ap-form h2{margin-bottom:22px}

.ap-chosen{display:flex;align-items:center;gap:14px;padding:14px 18px;border-radius:20px;background:radial-gradient(circle at 88% 18%,rgba(12,127,75,.38) 0%,rgba(12,127,75,0) 55%),#0D3A2D;color:var(--white)}
.ap-chosen .cat-ic{width:46px;height:46px;border-radius:14px;background:rgba(229,220,95,.08);border:1px solid rgba(229,220,95,.5);color:#E5DC5F}
.ap-chosen-text{display:flex;flex-direction:column;min-width:0}
.ap-chosen-text small{font-size:12.5px;color:rgba(255,255,255,.72)}
.ap-chosen-text b{font-size:17px;line-height:1.5}
.ap-chosen .ap-link{margin-inline-start:auto;color:#E5DC5F}
.ap-chosen .ap-link:focus-visible{outline-color:#E5DC5F}
.ap-link{padding:0;border:0;background:none;font:inherit;font-weight:600;color:var(--green);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.ap-link:hover{color:var(--green-deep)}

.ap-field{margin-top:26px}
.ap-label{display:block;font-size:15px;font-weight:600;color:var(--black)}
.req{color:var(--green)}
.ap-hint{margin:4px 0 0;font-size:13.5px;color:#616566}
.ap-err{margin:8px 0 0;font-size:13.5px;color:#B42318}

/* the drop zone: the file input covers it, so a click opens the picker and a dropped file lands in the input */
.ap-drop{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:12px;padding:32px 20px;border:2px dashed rgba(12,127,75,.45);border-radius:22px;background:rgba(12,127,75,.04);text-align:center;color:var(--green-deep);transition:background .2s,border-color .2s}
.ap-drop:hover,.ap-drop.is-over{background:rgba(12,127,75,.1);border-color:var(--green)}
.ap-drop:focus-within{outline:2px solid var(--green-deep);outline-offset:3px}
.ap-drop.is-invalid{border-color:#B42318;background:#FDF3F2}
.ap-file-input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.ap-drop-ic{display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:var(--white);color:var(--green);box-shadow:0 8px 20px -12px rgba(4,87,73,.6)}
.ap-drop-text{font-size:15px}
.ap-browse{font-weight:700;color:var(--green);text-decoration:underline;text-underline-offset:3px}
.ap-picked{display:flex;align-items:center;gap:12px;margin-top:12px;padding:12px 14px;border-radius:18px;background:#F4F5EB;border:1px solid rgba(12,127,75,.25)}
.ap-picked-ic{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:rgba(12,127,75,.12);color:var(--green)}
.ap-picked-text{display:flex;flex-direction:column;min-width:0}
.ap-picked-text b{font-size:15px;line-height:1.5;color:var(--green-deep);overflow-wrap:anywhere}
.ap-picked-text small{font-size:12.5px;color:#616566;text-align:start}
.ap-remove{flex:none;margin-inline-start:auto;display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:50%;background:transparent;color:#616566;cursor:pointer}
.ap-remove:hover{background:rgba(180,35,24,.08);color:#B42318}

.ap-physical{display:flex;align-items:flex-start;gap:14px;margin-top:24px;padding:18px 20px;border-radius:20px;background:rgba(233,218,122,.3);color:var(--green-deep);font-size:15px;line-height:1.8}
.ap-physical b{display:block;margin-bottom:2px;font-size:16px}
.ap-physical-ic{flex:none;display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:var(--white);color:var(--green-deep)}

.ap-terms{margin-top:26px;padding:16px 18px;border-radius:18px;border:1px solid rgba(188,190,192,.85);transition:border-color .2s,background .2s}
.ap-terms:has(input:checked){border-color:var(--green);background:rgba(12,127,75,.05)}
.ap-terms.is-invalid{border-color:#B42318}
.ap-check{display:flex;align-items:flex-start;gap:12px;font-size:15px;line-height:1.7;cursor:pointer}
.ap-check input{flex:none;width:20px;height:20px;margin:3px 0 0;accent-color:var(--green)}
.ap-terms .ap-hint{padding-inline-start:32px}

.ap-alert{margin-top:20px;padding:12px 16px;border-radius:14px;border:1px solid #F5B7B1;background:#FDECEA;color:#7A1A14;font-size:14.5px;line-height:1.7}
.ap-progress{margin-top:18px;height:8px;border-radius:999px;background:rgba(12,127,75,.12);overflow:hidden}
.ap-progress span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--green),var(--yellow));transition:width .2s}
[dir="rtl"] .ap-progress span{background:linear-gradient(270deg,var(--green),var(--yellow));margin-inline-start:0}

/* done: the full moon */
.ap-done,.ap-guest{text-align:center}
.ap-done-moon,.ap-guest-moon{display:inline-grid;place-items:center;width:104px;height:104px;margin-bottom:22px;border-radius:50%;background:radial-gradient(circle at 50% 40%,#13563F,#0D3A2D 70%);color:#E5DC5F}
.ap-done-moon{box-shadow:0 0 0 8px rgba(233,218,122,.22),0 0 48px rgba(233,218,122,.5)}
.ap-guest-moon{width:88px;height:88px;box-shadow:0 0 0 8px rgba(233,218,122,.18)}
.ap-done>p,.ap-guest>p{margin:12px auto 0;max-width:540px;font-size:16px;color:#4d5253}
.ap-code{display:inline-flex;flex-direction:column;align-items:center;margin:22px auto 0 !important;padding:14px 30px;border-radius:20px;background:var(--cream)}
.ap-code small{font-size:13px;color:var(--green-muted)}
.ap-code b{font-size:26px;font-weight:700;letter-spacing:.06em;color:var(--green-deep)}
.ap-qr{max-width:380px;margin:24px auto 0;padding:22px;border-radius:24px;border:1px solid rgba(12,127,75,.25)}
.ap-qr h3{margin:0;font-size:17px;color:var(--green-deep)}
.ap-qr img{display:block;width:200px;height:200px;margin:14px auto}
.ap-qr p{margin:0 0 14px;font-size:14px;color:#7A5A00}
.ap-guest-org{margin-top:22px !important;font-size:14.5px}
.ap-guest-org a{font-weight:600;color:var(--green)}

/* terms dialog */
.ap-dialog{width:min(700px,calc(100% - 32px));max-height:min(82vh,760px);padding:0;border:0;border-radius:24px;background:var(--white);color:var(--black);box-shadow:0 40px 90px -30px rgba(0,0,0,.6);overflow:hidden}
.ap-dialog[open]{display:flex;flex-direction:column}
.ap-dialog::backdrop{background:rgba(6,20,14,.62)}
.ap-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 24px;border-bottom:1px solid rgba(188,190,192,.6)}
.ap-dialog-head h2{margin:0;font-size:20px;color:var(--green-deep)}
.ap-x{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:50%;background:transparent;color:#616566;cursor:pointer}
.ap-x:hover{background:#F4F5EB}
.ap-dialog-body{flex:1 1 auto;overflow:auto;padding:18px 24px;font-size:15px;line-height:1.9;color:#333}
.ap-dialog-body h4{margin:16px 0 4px;font-size:16px;color:var(--green-deep)}
.ap-dialog-body h4:first-child{margin-top:0}
.ap-dialog-body p{margin:0}
.ap-dialog-foot{padding:14px 24px;border-top:1px solid rgba(188,190,192,.6);text-align:center}
.ap-dialog :focus-visible{outline:2px solid var(--green-deep);outline-offset:2px}

/* ---------- tablets and phones ---------- */
@media (max-width:1100px){
  .ap-cats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .ap-sheet{padding:56px 0 80px}
  .ap-steps{margin-bottom:38px}
  .ap-mark-text small{display:none}
  .ap-mark-text{font-size:13.5px}
  .ap-moon{width:48px;height:48px}
  .ap-stepper-item+.ap-stepper-item::before{top:23px;inset-inline-end:calc(50% + 34px);width:calc(100% - 68px)}
  .ap-card{padding:28px 20px;border-radius:26px}
}
@media (max-width:640px){
  .ap-cats{grid-template-columns:minmax(0,1fr)}
  .ap-cats .cat-tab{min-height:190px}
  .ap-actions .btn{flex:1 1 auto}
}
