/* ===== Modal System ===== */
.modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;background:rgba(10,10,12,.72);backdrop-filter:blur(6px);padding:20px;animation:fadeIn .25s ease}
.modal.open{display:flex}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes popIn{from{opacity:0;transform:translateY(20px) scale(.97)}to{opacity:1;transform:none}}
.modal-box{background:#fff;border-radius:18px;max-width:580px;width:100%;max-height:88vh;overflow-y:auto;position:relative;box-shadow:0 30px 80px rgba(0,0,0,.35);animation:popIn .3s cubic-bezier(.2,.7,.2,1)}
.modal-box.wide{max-width:780px}
.modal-box.dark{background:#161616;color:#fff}
.modal-close{position:absolute;top:14px;right:16px;width:36px;height:36px;border-radius:50%;border:0;background:#f1f2f4;color:#2b2b2b;font-size:20px;cursor:pointer;display:grid;place-items:center;transition:.2s;z-index:5}
.modal-close:hover{background:#e2001a;color:#fff;transform:rotate(90deg)}
.modal-box.dark .modal-close{background:#2a2a2a;color:#fff}
.modal-head{padding:28px 32px 18px;border-bottom:1px solid #eee}
.modal-box.dark .modal-head{border-bottom-color:#2a2a2a}
.modal-head h3{font-size:24px;font-weight:900;margin-bottom:6px}
.modal-head p{color:#6b7177;font-size:14px}
.modal-box.dark .modal-head p{color:#9aa0a6}
.modal-body{padding:24px 32px 28px}
.modal-foot{padding:18px 32px 24px;border-top:1px solid #eee;display:flex;justify-content:flex-end;gap:10px}
.modal-box.dark .modal-foot{border-top-color:#2a2a2a}

/* Form */
.mform{display:grid;gap:16px}
.mform label{display:grid;gap:6px;font-size:13px;font-weight:600;color:#2b2b2b}
.modal-box.dark .mform label{color:#e5e7eb}
.mform input,.mform select,.mform textarea{padding:12px 14px;border:1px solid #d7dae0;border-radius:10px;font-size:14px;font-family:inherit;transition:.2s;background:#fff;color:#2b2b2b;width:100%}
.mform textarea{min-height:100px;resize:vertical}
.mform input:focus,.mform select:focus,.mform textarea:focus{outline:none;border-color:#e2001a;box-shadow:0 0 0 3px rgba(226,0,26,.12)}
.modal-box.dark .mform input,.modal-box.dark .mform select,.modal-box.dark .mform textarea{background:#1f1f1f;border-color:#333;color:#fff}
.modal-box.dark .mform input:focus{box-shadow:0 0 0 3px rgba(244,121,32,.15)}
.mform .row{display:grid;grid-template-columns:1fr 1fr;gap:14px}

/* Robot detail modal */
.rd-hero{display:grid;grid-template-columns:1fr 1fr;gap:26px;margin-bottom:22px}
.rd-hero img{width:100%;border-radius:12px;background:#f4f5f7;aspect-ratio:4/3;object-fit:cover}
.rd-specs{display:grid;gap:0}
.rd-spec{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px dashed #eee;font-size:14px}
.modal-box.dark .rd-spec{border-bottom-color:#2a2a2a}
.rd-spec dt{color:#6b7177}
.rd-spec dd{font-weight:700;color:#2b2b2b}
.modal-box.dark .rd-spec dd{color:#fff}
.rd-tags{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.rd-tags span{font-size:12px;padding:5px 12px;border-radius:30px;background:#fff5f5;color:#e2001a;font-weight:700}
.modal-box.dark .rd-tags span{background:#2a2020;color:#ff8a6a}

/* Success toast */
.toast{position:fixed;top:90px;left:50%;transform:translateX(-50%) translateY(-20px);background:#161616;color:#fff;padding:14px 24px;border-radius:12px;box-shadow:0 16px 40px rgba(0,0,0,.3);z-index:10000;opacity:0;pointer-events:none;transition:.35s;display:flex;align-items:center;gap:10px;font-size:14px;font-weight:500}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast .dot{width:8px;height:8px;border-radius:50%;background:#22c55e}
.toast.err .dot{background:#ef4444}

/* Mobile */
@media(max-width:560px){
  .modal{padding:12px}
  .modal-box{border-radius:14px;max-height:92vh}
  .modal-head,.modal-body,.modal-foot{padding-left:20px;padding-right:20px}
  .rd-hero{grid-template-columns:1fr}
  .mform .row{grid-template-columns:1fr}
}
