:root {
  --c-prim: #06b6d4;
  --c-prim-dk: #0891b2;
  --c-bg: #f0f9ff;
  --c-bg-dk: #e0f2fe;
  --c-txt: #1e3a5f;
  --c-txt-lt: #64748b;
  --c-grad-a: #0f172a;
  --c-grad-b: #1e3a5f;
  --c-grad-r: #942a07;
}

html { font-family: sans-serif; }
body { padding: 0 20px 20px; background: linear-gradient(135deg, var(--c-grad-a) 0%, var(--c-grad-b) 100%); min-height: 100vh; }
a { background-color: transparent; cursor: pointer;}
a:active, a:hover { outline: 0; }
b { font-weight: 700; }
h1 { font-size: 36px; margin: 10px 0 5px; color: var(--c-txt); }
h2 { font-size: 24px; color: var(--c-txt); font-weight: 600; margin: 4px auto; }

input[type=checkbox] { box-sizing: border-box; padding: 0; }
input[type=text], input[type=number], input[type=password], select {
  height: 40px; width: 90%; padding: 0 0 0 20px;
  border: 2px solid var(--c-bg-dk); border-radius: 8px;
  font-size: 16px; background-color: var(--c-bg); color: #0f172a; transition: 0.3s;
}
input[type=file] { display: none; }
input::placeholder { color: var(--c-txt-lt); }
input:hover { border-color: var(--c-prim); box-shadow: 0 0 12px rgba(6, 182, 212, 0.2); }
input:focus, select:focus { border-color: var(--c-prim-dk); outline: 0; box-shadow: 0 0 16px rgba(6, 182, 212, 0.3); }
footer { text-align: center; font-size: 12px; margin: 40px; color: #cbd5e1; }

button, .btn {
  display: inline-flex; padding: 10px 10px;
  background: linear-gradient(135deg, var(--c-prim) 0%, var(--c-prim-dk) 100%);
  color: #fff; border: 0; cursor: pointer; min-width: 40%;
  border-radius: 8px; justify-content: center; font-weight: 600;
  transition: 0.3s; box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}
button:hover, .btn:hover { box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4); filter: brightness(1.2); }
#update-btn{ padding: 6px; min-width: 0; background: var(--c-grad-r); } 
#update-btn[aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; box-shadow: none;}

ul { display: table; text-align: left; margin: 0 auto 10px; color: #e2e8f0; }
hr { width: 100%; order: 997; border: 1px solid rgba(6, 182, 212, 0.3); }
select { width: 92.5%; background-color: var(--c-bg); }

.input-label {
  align-self: self-start; color: var(--c-prim-dk); position: relative;
  left: 5%; bottom: -5px; border-radius: 6px;
  border: 2px solid var(--c-bg-dk); background-color: var(--c-bg);
  font-size: 13.5px; padding: 2px 10px 0; font-weight: 600; transition: 0.3s;
}
.input-label:hover { border-color: var(--c-prim); background-color: #cffafe; }
.firmware { width: 100%; display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; }
.firmware .fw-upload { margin-bottom: 0; }
.form { display: flex; flex-direction: column; align-items: center; width: 100%; }

.row-wrapper { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 20px; margin-bottom: 14px;}
.tf-wrapper { display: flex; margin-bottom: 10px; flex-direction: column; align-items: center; }

/* Loader */
.loading { color: var(--c-prim); text-align: center; font-weight: 600; }
.loader { position: relative; height: auto; overflow: hidden; }
.spinH { top: 50%; position: absolute; height: 8px; width: 8px; background: var(--c-prim); border-radius: 100%; box-shadow: 0 0 8px var(--c-prim); }
.spin-1H { animation: spinnerH 3s linear infinite; }
.spin-2H { animation: spinnerH 3s 0.1s linear infinite; }
.spin-3H { animation: spinnerH 3s 0.2s linear infinite; }
.spin-4H { animation: spinnerH 3s 0.3s linear infinite; }
@keyframes spinnerH { 0% { transform: translateX(0); } 20% { transform: translate(200px); } 70% { transform: translateX(505px); } 100% { transform: translateX(800px); } }

/* Progress */
.progress-wrap {
  text-align: center; position: relative; width: 80%; height: 25px; margin: 20px auto;
  background: rgba(6, 182, 212, 0.1); font-size: 20px; transition: 0.4s;
  border-radius: 8px; border: 2px solid var(--c-prim);
}
.progress-wrap:not(.active) { cursor: pointer; background: rgba(6, 182, 212, 0.05); }
.progress-wrap .progress { width: 0; z-index: 5; background: linear-gradient(90deg, var(--c-prim) 0%, var(--c-prim-dk) 100%); opacity: 0; transition: 0.3s; position: absolute; inset: 0;}
.progress-wrap.active .progress { opacity: 1; animation: progress-anim 10s ease 0s; }

/* Modal */
.d-modal {
  border-radius: 12px; border: 2px solid var(--c-prim);
  background: linear-gradient(135deg, var(--c-bg) 0%, var(--c-bg-dk) 100%);
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.3);
  position: relative; flex-direction: column; min-width: 400px;
}
#modal-message { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 1000; }
#modal-message[open] { display: flex; }
#modal-message::before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(1px); z-index: -1; }
.d-modal-title { color: #0f172a; padding: 1.5em; width: calc(100% - 4.5em); font-weight: 600; }
.d-modal-content { border-top: 2px solid var(--c-prim); padding: 1.5em; overflow: auto; color: #0f172a; }

/* Nav */
.topnav { margin-top: 12px; background: linear-gradient(135deg, var(--c-grad-a) 0%, var(--c-grad-b) 100%); border-radius: 8px; align-self: flex-end; border: 2px solid var(--c-prim); }
.topnav a { float: left; color: #e2e8f0; padding: 6px 12px; font-size: 16px; }
.topnav a:hover { color: var(--c-prim); }
.topnav a.active { background: linear-gradient(180deg, var(--c-prim) 0%, #026881 100%); color: #fff; font-weight: 600; background: none; }
.topnav .icon { display: none; }

.ctn {
  display: flex; flex-direction: column; position: relative; max-width: 840px;
  margin: 0 auto 6px; padding: 8px 40px; border-radius: 12px;
  border: 1px solid var(--c-prim);
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.65) 0%, rgba(240, 249, 255, 0.95) 100%);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.2);
}
.ctn:after { content: " "; display: table; clear: both; }

/* Sliders */
.slider-wrapper { display: flex; align-items: center; gap: 14px; width: 92.5%; background-color: var(--c-bg); border-radius: 8px;}
.slider-wrapper .slider {
  appearance: none; margin-left: 20px; width: 100%; height: 10px; border-radius: 999px;
  background: #e2e8f0; outline: none; transition: .2s;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}
.slider-wrapper .slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-prim) 0%, var(--c-prim-dk) 100%);
  border: 2px solid var(--c-bg-dk); box-shadow: 0 2px 6px rgba(6, 182, 212, 0.4); cursor: pointer;
}
.slider-wrapper .slider-readout { width: 60px; height: 40px; text-align: center; border: none; }

/* Toggles */
.toggle { cursor: pointer; display: block; padding: 4px; margin-left: -12px;}
.toggle-label { margin: 0 10px; position: relative; top: 2px; color: #0f172a; font-weight: 500; }
.toggle-switch { display: inline-block; background: #cbd5e1; border-radius: 16px; width: 58px; height: 32px; position: relative; vertical-align: middle; transition: background .25s; }
.toggle-switch:before { content: ""; display: block; background: linear-gradient(to bottom, #fff 0%, var(--c-bg) 100%); border-radius: 50%; box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.3); width: 24px; height: 24px; position: absolute; top: 4px; left: 4px; transition: left .25s; }
.t-check:checked + .toggle-switch { background: linear-gradient(135deg, var(--c-prim) 0%, var(--c-prim-dk) 100%); box-shadow: 0 0 12px rgba(6, 182, 212, 0.4); }
.t-check:checked + .toggle-switch:before { left: 30px; background: linear-gradient(to bottom, var(--c-bg) 0%, var(--c-bg-dk) 100%); }
.t-check { position: absolute; visibility: hidden; }
.lbl-wifi { margin-left: 0px; }

/* Utils */
.title { display: flex; margin: -10px 0 -14px 0;}
.heading { width: 100%; text-align: right; color: var(--c-prim-dk); }
.pswd { display: flex; flex-direction: row; align-items: center; width: 100%; justify-content: center; }
.show-hide-wrap { position: absolute; right: 10%; cursor: pointer; color: var(--c-prim); }
.btn-bar { display: flex; padding: 10px; justify-content: center; flex-wrap: wrap; gap: 20px 30px; order: 998; }
.fw-upload { display: inline-block; padding: 12px 20px; cursor: pointer; border-radius: 8px; margin-bottom: 20px; background: linear-gradient(135deg, var(--c-prim) 0%, var(--c-prim-dk) 100%); color: #fff; font-weight: 600; transition: 0.3s; box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3); }
.fw-upload[aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; box-shadow: none; }
.hide { display: none; }
.svg { display: flex; width: 20px; margin-right: 10px; }
.table { width: 90%; margin: auto; border-collapse: collapse; }

/* Responsive */
@media screen and (max-width: 608px) {
  h1 { font-size: 24px; }
  .btn-bar { margin-top: 20px;}
  .topnav { margin: 4px; width: auto; min-width: 200px; align-self: flex-start;}
  .topnav a { padding: 5px 12px; }
  .topnav a:not(.active) { display: none; }
  .topnav a.icon {display: block; }
  .topnav.responsive { flex-direction: column; width: auto; }
  .topnav.responsive .icon { display: none; }
  .topnav.responsive a { float: none; display: block; text-align: left; width: 100%; }
  .hide-tiny { display: none; }
}

@media screen and (max-width: 479px) {
  body { padding: 2px; }
  select { width: 95.5% }
  .ctn { padding: 0 10px; }
}

/* Creds & Inline */
.cred-tabs { display: flex; align-items: flex-end; margin: 10px 0 0; }
.cred-tab { display: inline-flex; align-items: center; justify-content: center; min-width: auto; border-radius: 8px 8px 0 0; background: var(--c-grad-b); color: #8f9195; padding: 8px 12px; font-size: 14px; margin-right: 4px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.cred-tab.active { background: var(--c-bg-dk); color: var(--c-prim-dk); border: 2px solid var(--c-prim); border-bottom: 2px solid var(--c-bg-dk); z-index: 2; }
#wifi, #wifi-table { border: 2px solid var(--c-prim); background: var(--c-bg-dk); padding: 20px; margin-bottom: 10px; }

.tf-wrapper.inline-creds { flex-direction: row-reverse; justify-content: end; width: 100%; }
.btn-bar.compact { padding: 0; justify-content: flex-start; gap: 10px; display: inline-flex; align-items: center;}
.btn.small { padding: 8px 16px; min-width: fit-content; width: auto; border-radius: 6px; font-size: 14px; background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3); }