/* IALE Institute, Accredited AI Skills Academy · The AI Toolkit
   Mobile-first: a shared link opens full-screen on a phone. On a wide screen
   the chat sits in a device frame on an IALE backdrop.
   Brand: Navy #1B3A5C · Gold #C9A84C · Teal #2E8B8B */
:root{
  --navy:#1B3A5C; --gold:#C9A84C; --teal:#2E8B8B;
  --wa-header:#008069; --wa-bg:#EFEAE2; --wa-out:#D9FDD3; --wa-in:#FFFFFF;
  --wa-tick:#53BDEB; --wa-panel:#F0F2F5; --wa-text:#111B21; --wa-sub:#667781;
  --shadow:0 1px 0 rgba(11,20,26,.13);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:'Segoe UI',system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;
  color:var(--wa-text);background:var(--wa-bg)}
.hidden{display:none!important}
.screen{min-height:100vh;min-height:100dvh}

/* ===================== REGISTRATION ===================== */
.reg{display:flex;align-items:flex-start;justify-content:center;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(46,139,139,.30), transparent 60%),
    radial-gradient(700px 420px at 5% 110%, rgba(201,168,67,.25), transparent 55%),
    linear-gradient(160deg,#0f2236,#1B3A5C 60%,#11293f);
  padding:18px}
.reg-card{width:100%;max-width:460px;background:#fff;border-radius:18px;
  padding:22px 20px 26px;box-shadow:0 24px 60px rgba(0,0,0,.45);margin:14px 0}
.reg-brand{display:flex;align-items:center;gap:11px;margin-bottom:14px}
.reg-brand .mark{width:44px;height:44px;border-radius:11px;flex:0 0 auto;
  background:linear-gradient(145deg,var(--gold),#b8902f);color:var(--navy);
  font-weight:800;display:grid;place-items:center;font-size:17px}
.reg-brand strong{display:block;color:var(--navy);font-size:17px;line-height:1.1}
.reg-brand span{font-size:12px;color:var(--teal);font-weight:600}
.reg-hero{border-radius:14px;overflow:hidden;line-height:0;margin-bottom:16px}
.reg-hero svg{width:100%;height:auto;display:block}
.reg-card h1{color:var(--navy);font-size:26px;margin-bottom:4px}
.tagline{color:#33485a;font-size:14.5px;font-style:italic;margin-bottom:8px}
.presented{color:var(--wa-sub);font-size:13px;margin-bottom:16px}
.presented strong{color:var(--navy)}
.features{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:20px}
.feat{background:#f4f7f8;border:1px solid #e6edee;border-radius:11px;
  padding:10px 4px;text-align:center}
.fic{height:30px;margin-bottom:5px}
.fic svg{height:30px;width:auto}
.feat span{font-size:10.5px;color:var(--navy);font-weight:600;line-height:1.2;display:block}
.formlead{font-size:13px;color:#445;line-height:1.5;
  background:#f4f8f8;border-left:3px solid var(--teal);padding:10px 12px;
  border-radius:6px;margin-bottom:16px}
form label{display:block;font-size:12.5px;font-weight:600;color:var(--navy);
  margin-bottom:13px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
form input[type=text],form input:not([type]),form input[name],form select{
  width:100%;margin-top:5px;padding:12px 12px;border:1.5px solid #d4dde0;
  border-radius:9px;font:inherit;font-size:15px;font-weight:400;color:var(--wa-text);
  background:#fff}
form input:focus,form select:focus{outline:none;border-color:var(--teal);
  box-shadow:0 0 0 3px rgba(46,139,139,.15)}
form input.bad,form select.bad{border-color:#c0392b;background:#fff7f6}
.err{display:block;color:#c0392b;font-size:11.5px;font-weight:600;margin-top:4px;min-height:2px}
.consent{display:flex;gap:10px;align-items:flex-start;font-weight:400;
  font-size:12px;color:#445;line-height:1.5;background:#fbfaf4;
  border:1px solid #efe7c9;border-radius:9px;padding:12px;margin-bottom:4px}
.consent input{margin-top:2px;width:18px;height:18px;flex:0 0 auto;accent-color:var(--teal)}
#reg-submit{width:100%;margin-top:12px;padding:15px;border:0;border-radius:11px;
  background:linear-gradient(135deg,var(--navy),#16314c);color:#fff;font-size:16px;
  font-weight:700;cursor:pointer;letter-spacing:.3px}
#reg-submit:hover{filter:brightness(1.08)}
#reg-submit:disabled{opacity:.6;cursor:default}
#resume-submit{width:100%;margin-top:6px;padding:15px;border:0;border-radius:11px;
  background:linear-gradient(135deg,var(--teal),#256f6f);color:#fff;font-size:16px;
  font-weight:700;cursor:pointer;letter-spacing:.3px}
#resume-submit:hover{filter:brightness(1.08)}
#resume-submit:disabled{opacity:.6;cursor:default}
.reg-alt{text-align:center;font-size:13px;color:var(--wa-sub);margin-top:16px}
.linklike{background:none;border:0;color:var(--teal);font:inherit;font-size:13px;
  font-weight:700;cursor:pointer;padding:0;text-decoration:underline}
.linklike:hover{color:var(--navy)}
.reg-foot{text-align:center;font-size:11px;color:var(--wa-sub);margin-top:14px}
.adminlink{display:block;text-align:center;font-size:12px;color:var(--teal);
  margin-top:10px;text-decoration:none}
.adminlink:hover{text-decoration:underline}

/* ===================== WHATSAPP CHAT ===================== */
.chat{background:#0b141a}
.stage{min-height:100vh;min-height:100dvh;display:flex;align-items:stretch;
  justify-content:center}
.phone{width:100%;display:flex}
.wa{width:100%;display:flex;flex-direction:column;background:var(--wa-bg);
  height:100vh;height:100dvh}

.wa-header{background:var(--wa-header);color:#fff;display:flex;align-items:center;
  gap:10px;padding:max(12px,env(safe-area-inset-top)) 12px 10px;flex:0 0 auto}
.wa-header .back{font-size:22px;cursor:pointer;width:16px;opacity:.95}
.wa-avatar{width:38px;height:38px;border-radius:50%;flex:0 0 auto;
  background:linear-gradient(145deg,var(--gold),#a87f28);color:var(--navy);
  display:grid;place-items:center;font-weight:800;font-size:13px;
  border:1.5px solid rgba(255,255,255,.5)}
.wa-id{flex:1;min-width:0}
.wa-id .name{font-size:16px;font-weight:600;display:flex;align-items:center;gap:5px;
  white-space:nowrap;overflow:hidden}
.wa-id .name svg{width:15px;height:15px;flex:0 0 auto}
.wa-id .pres{font-size:12px;color:#d3efe7;height:14px}
.wa-header .icons{display:flex;gap:16px;font-size:16px;opacity:.95;flex:0 0 auto}

.wa-chat{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:14px 9px 10px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'><g fill='none' stroke='%23d8cfc0' stroke-width='1' opacity='0.4'><circle cx='10' cy='10' r='3'/><path d='M30 8h12M36 4v8'/><path d='M44 30l5 5-5 5'/><circle cx='14' cy='40' r='4'/><path d='M26 44h14'/></g></svg>");
  background-color:var(--wa-bg);display:flex;flex-direction:column;gap:3px}
.wa-chat>*{flex:0 0 auto}
.wa-chat::-webkit-scrollbar{width:5px}
.wa-chat::-webkit-scrollbar-thumb{background:rgba(0,0,0,.16);border-radius:3px}

.daystamp{align-self:center;background:#fff;color:var(--wa-sub);font-size:12px;
  padding:5px 12px;border-radius:8px;box-shadow:var(--shadow);margin:8px 0}
.enc{align-self:center;background:#FDF4C9;color:#54656f;font-size:11.5px;text-align:center;
  padding:7px 12px;border-radius:8px;margin:4px 18px 10px;line-height:1.5}

.msg{max-width:84%;display:flex;flex-direction:column;animation:pop .18s ease-out}
@keyframes pop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.msg.in{align-self:flex-start}
.msg.out{align-self:flex-end}
.bubble{position:relative;padding:7px 10px 8px;border-radius:9px;font-size:14.4px;
  line-height:1.46;box-shadow:var(--shadow);word-wrap:break-word;white-space:pre-wrap}
.msg.in .bubble{background:var(--wa-in);border-top-left-radius:2px}
.msg.out .bubble{background:var(--wa-out);border-top-right-radius:2px}
.msg.in .bubble::before{content:"";position:absolute;top:0;left:-7px;border:7px solid transparent;
  border-top-color:var(--wa-in);border-right:0}
.msg.out .bubble::before{content:"";position:absolute;top:0;right:-7px;border:7px solid transparent;
  border-top-color:var(--wa-out);border-left:0}
.bubble b{font-weight:700}
.bubble em{color:#3b4a54;font-style:italic}
.meta{font-size:10.5px;color:var(--wa-sub);display:flex;gap:4px;justify-content:flex-end;
  margin-top:2px;align-items:center}
.msg.out .ticks{color:var(--wa-tick);font-weight:700;letter-spacing:-2px}
.sysline{align-self:center;background:#cfe9dd;color:#0a5c43;font-size:12.5px;font-weight:600;
  padding:7px 14px;border-radius:8px;margin:7px 14px;text-align:center;box-shadow:var(--shadow)}
/* lesson section header, small relevant icon + title, reads as a divider */
.sec-head{align-self:stretch;display:flex;align-items:center;gap:10px;
  margin:10px 6px 4px;padding:7px 12px;background:#fff;border-radius:10px;
  border-left:4px solid var(--teal);box-shadow:var(--shadow);
  animation:pop .18s ease-out}
.sec-ic{width:30px;height:30px;flex:0 0 auto;line-height:0}
.sec-ic svg{width:30px;height:30px;display:block}
.sec-ic.emb svg{border-radius:7px}
.sec-tx{font-size:14px;font-weight:700;color:var(--navy);line-height:1.3}

/* WhatsApp-style image message carrying the module illustration */
.bubble.photo{padding:4px 4px 6px;max-width:300px}
.bubble.photo .illus{border-radius:7px;overflow:hidden;line-height:0;background:var(--navy)}
.bubble.photo .illus svg{width:100%;height:auto;display:block}
.bubble.photo .meta{padding:0 6px}
.msg.in .bubble.photo::before{display:none}
/* compact emblem on the Principle Card header */
.card.principle .hd{display:flex;align-items:center;gap:8px}
.card.principle .hd .gem{flex:0 0 auto}
.card.principle .hd .pemblem{margin-left:auto;flex:0 0 auto;line-height:0}
.card.principle .hd .pemblem svg{width:34px;height:34px;display:block;border-radius:8px}

.msg.in.admin .bubble{background:#FFF4D6;border:1px solid var(--gold);border-top-left-radius:2px}
.adminhdr{font-size:11px;font-weight:800;color:#8a6d12;text-transform:uppercase;
  letter-spacing:.4px;margin-bottom:4px}

.typing{align-self:flex-start;background:var(--wa-in);border-radius:9px;border-top-left-radius:2px;
  padding:11px 14px;box-shadow:var(--shadow);display:flex;gap:4px}
.typing span{width:7px;height:7px;border-radius:50%;background:#9aa6ad;animation:blink 1.2s infinite}
.typing span:nth-child(2){animation-delay:.2s}.typing span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* cards */
.card{border-radius:10px;overflow:hidden;box-shadow:var(--shadow);max-width:100%}
.card.principle{background:#fffdf6;border:1.5px solid var(--gold)}
.card.principle .hd{background:linear-gradient(135deg,var(--navy),#16314c);color:#fff;
  padding:9px 12px;font-size:12px;font-weight:700;letter-spacing:.5px}
.card.principle .hd .gem{color:var(--gold)}
.card.principle .row{padding:8px 12px;font-size:13.3px;line-height:1.5;border-bottom:1px solid #f0e8cf}
.card.principle .row:last-child{border-bottom:0}
.card.principle .k{font-weight:700;color:var(--navy);font-size:11px;text-transform:uppercase;
  letter-spacing:.4px;display:block;margin-bottom:2px}
.card.principle .prompt{background:#f4f8f8;border-left:3px solid var(--teal);
  font-family:Consolas,monospace;font-size:12.3px;color:#16313c}
.card.apply{background:#f1faf8;border:1.5px solid var(--teal)}
.card.apply .hd{background:var(--teal);color:#fff;padding:9px 12px;font-weight:700;
  font-size:13px;display:flex;justify-content:space-between;align-items:center}
.card.apply .bd{padding:10px 12px;font-size:13.6px;line-height:1.55;color:#13343b;white-space:pre-wrap}
.card.apply .clock{background:rgba(255,255,255,.22);padding:2px 9px;border-radius:999px;font-size:11.5px}
.card.rubric{background:#fff;border:1px solid #e3e7ea}
.card.rubric .hd{background:var(--navy);color:#fff;padding:8px 12px;font-weight:700;font-size:12.5px}
.card.rubric table{width:100%;border-collapse:collapse;font-size:11.3px}
.card.rubric td,.card.rubric th{border:1px solid #e7ebee;padding:6px 7px;vertical-align:top;text-align:left}
.card.rubric th{background:#f3f1ea;color:var(--navy);font-size:10.5px;text-transform:uppercase}
.card.rubric td:first-child{font-weight:700;color:var(--navy);background:#faf8f2}
.card.rubric .pass{background:#f0f8f3}
.card.report{background:#fff;border:1.5px solid var(--navy)}
.card.report .hd{background:linear-gradient(135deg,var(--navy),#16314c);color:#fff;
  padding:10px 12px;font-weight:700;font-size:13px}
.card.report .rtitle{padding:8px 12px 4px;font-weight:700;color:var(--navy);font-size:13px}
.card.report .rbody{padding:2px 12px 8px}
.card.report .rline{display:flex;justify-content:space-between;font-size:13px;
  padding:5px 0;border-bottom:1px dashed #e5e9ec;color:#33485a}
.card.report .rline:last-child{border-bottom:0}
.card.report .rline b{color:var(--navy)}
.card.report .rcum{background:#eef4f1;border-top:2px solid var(--teal);
  padding:9px 12px;font-size:12.5px;color:#234}
.card.report .rcum b{color:var(--teal)}

/* quick replies, links, list */
.qr{align-self:flex-end;display:flex;flex-direction:column;gap:6px;max-width:84%;margin:3px 0 6px}
.qr button,.qr .linkbtn{background:#fff;color:var(--teal);border:1px solid #d9e2e6;
  border-radius:9px;padding:12px;font-size:14.5px;font-weight:600;cursor:pointer;
  box-shadow:var(--shadow);text-align:center;text-decoration:none;display:block}
.qr .linkbtn{background:linear-gradient(135deg,var(--teal),#256f6f);color:#fff;border:0}
.qr .linkbtn.checkout{background:linear-gradient(135deg,#1B4F6B,#2DAFE5);color:#fff;
  border:0;padding:14px;font-size:15.5px;letter-spacing:0.2px}
.qr button:active{transform:scale(.98)}
.qr button:hover{background:#f3fbf9}
.listmsg{align-self:flex-start;background:#fff;border-radius:10px;box-shadow:var(--shadow);
  width:92%;max-width:360px;overflow:hidden}
.listmsg .lh{padding:10px 12px;font-size:13px;color:#3b4a54;border-bottom:1px solid #eef1f3;background:#f7faf9}
.listmsg .li{display:flex;align-items:center;gap:10px;padding:12px;border-bottom:1px solid #f1f3f5;
  cursor:pointer;font-size:13.6px}
.listmsg .li:last-child{border-bottom:0}
.listmsg .li:hover{background:#f5f8f7}
.listmsg .li.locked{cursor:not-allowed;color:#9aa6ad}
.listmsg .li .ix{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  font-size:12px;font-weight:700;background:#eef3f1;color:var(--teal);flex:0 0 auto}
.listmsg .li.done .ix{background:var(--teal);color:#fff}
.listmsg .li.active .ix{background:var(--gold);color:var(--navy)}
.listmsg .li.locked .ix{background:#eceff1;color:#b3bdc2}
.listmsg .li .tx{flex:1;line-height:1.3;color:var(--wa-text)}
.listmsg .li.locked .tx{color:#9aa6ad}
.listmsg .li .tx small{display:block;color:var(--wa-sub);font-size:11px;margin-top:1px}
.listmsg .li .st{font-size:14px}

.wa-composer{background:var(--wa-panel);padding:8px 9px calc(8px + env(safe-area-inset-bottom));
  display:flex;align-items:flex-end;gap:7px;flex:0 0 auto}
.wa-composer .field{flex:1;background:#fff;border-radius:22px;display:flex;align-items:center;
  gap:8px;padding:10px 14px;box-shadow:var(--shadow)}
.wa-composer .field svg{width:19px;height:19px;color:#54656f;flex:0 0 auto}
.wa-composer textarea{flex:1;border:0;outline:0;resize:none;font:inherit;font-size:15px;
  max-height:80px;line-height:1.3;background:transparent;color:var(--wa-text)}
.wa-composer textarea::placeholder{color:#8696a0}
.wa-composer .send{width:46px;height:46px;border-radius:50%;background:var(--wa-header);
  color:#fff;border:0;display:grid;place-items:center;cursor:pointer;flex:0 0 auto}
.wa-composer .send svg{width:21px;height:21px}
.wa-composer .send:disabled{opacity:.5}

/* ---- desktop: device frame on IALE backdrop ---- */
@media (min-width:760px){
  .chat{background:
    radial-gradient(1100px 560px at 82% -8%, rgba(46,139,139,.26), transparent 60%),
    radial-gradient(820px 460px at 6% 110%, rgba(201,168,67,.22), transparent 55%),
    linear-gradient(135deg,#0f2236,#1B3A5C 58%,#11293f)}
  .stage{align-items:center;padding:22px}
  .phone{width:402px;height:842px;max-height:94vh;background:#000;border-radius:46px;
    padding:12px;box-shadow:0 30px 70px rgba(0,0,0,.55),inset 0 0 0 2px #2a2a2a;
    position:relative;flex:0 0 auto}
  .phone::before{content:"";position:absolute;top:14px;left:50%;transform:translateX(-50%);
    width:130px;height:25px;background:#000;border-radius:0 0 16px 16px;z-index:30}
  .wa{border-radius:36px;overflow:hidden;height:100%}
  .wa-header{padding:32px 14px 10px}
}
