:root{
  --bg0:#070A12;
  --bg1:#0B1022;
  --card: rgba(255,255,255,.08);
  --card2: rgba(255,255,255,.12);
  --text:#EAF0FF;
  --muted: rgba(234,240,255,.72);
  --muted2: rgba(234,240,255,.5);
  --line: rgba(255,255,255,.14);
  --shadow: 0 20px 80px rgba(0,0,0,.5);
  --r: 20px;
  --btn: rgba(255,255,255,.12);
  --btn2: rgba(255,255,255,.18);
  --ok: #29d49c;
  --bad: #ff5c7a;
  --warn: #ffca3a;
  --focus: rgba(41,212,156,.35);
}

[data-theme="light"]{
  --bg0:#f7f9ff;
  --bg1:#eef3ff;
  --card: rgba(0,0,0,.05);
  --card2: rgba(0,0,0,.08);
  --text:#0D1225;
  --muted: rgba(13,18,37,.72);
  --muted2: rgba(13,18,37,.55);
  --line: rgba(0,0,0,.12);
  --shadow: 0 16px 60px rgba(0,0,0,.15);
  --btn: rgba(0,0,0,.06);
  --btn2: rgba(0,0,0,.10);
  --focus: rgba(41,212,156,.25);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Cairo", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 15%, var(--bg1), var(--bg0));
  color: var(--text);
}

.bg{
  position:fixed; inset:0;
  overflow:hidden;
  pointer-events:none;
}
.grid{
  position:absolute; inset:-2px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity:.15;
  filter: blur(.2px);
}
.blob{
  position:absolute;
  width: 520px; height: 520px;
  border-radius: 999px;
  filter: blur(60px);
  opacity:.35;
  animation: float 10s ease-in-out infinite;
}
.b1{
  right:-180px; top:-160px;
  background: radial-gradient(circle at 30% 30%, #29d49c, transparent 65%),
              radial-gradient(circle at 70% 60%, #7c5cff, transparent 60%);
}
.b2{
  left:-220px; bottom:-220px;
  background: radial-gradient(circle at 40% 40%, #ff5c7a, transparent 65%),
              radial-gradient(circle at 70% 60%, #ffca3a, transparent 60%);
  animation-delay: -3s;
}

@keyframes float{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(16px,-18px) scale(1.04); }
}

.page{
  min-height:100%;
  display:flex;
  flex-direction:column;
  padding: clamp(16px, 3vw, 32px);
  gap: 18px;
  max-width: 1040px;
  margin: 0 auto;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.brand{
  display:flex; align-items:center; gap: 12px;
}
.logo{
  width:44px; height:44px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(41,212,156,.25), rgba(124,92,255,.22));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight:700;
}
.brandText .title{ font-size: 18px; font-weight:700; line-height:1.2; }
.brandText .sub{ font-size: 12px; color: var(--muted2); }

.iconBtn{
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor:pointer;
  transition: .2s ease;
}
.iconBtn:hover{ background: var(--btn2); transform: translateY(-1px); }

.card{
  width:min(560px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.tabs{
  display:flex;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}
.tab{
  flex:1;
  padding: 14px 12px;
  background: transparent;
  border: 0;
  cursor:pointer;
  color: var(--muted);
  font-weight:700;
  transition: .2s ease;
}
.tab.active{
  color: var(--text);
  background: rgba(255,255,255,.06);
}

.panels{ padding: 18px; }
.panel{ display:none; }
.panel.active{ display:block; }

h1{
  margin: 4px 0 6px;
  font-size: 22px;
}
.hint{
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.field{ display:block; margin: 12px 0; }
.label{
  display:block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight:600;
}
input{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline:none;
  font-size: 14px;
  transition: .15s ease;
}
input:focus{
  border-color: rgba(41,212,156,.55);
  box-shadow: 0 0 0 4px var(--focus);
}

.passwordWrap{
  display:flex;
  gap: 8px;
  align-items:center;
}
.passwordWrap input{ flex:1; }
.eyeBtn{
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
}
.eyeBtn:hover{ background: var(--btn2); }

.help{
  display:block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted2);
}

.primaryBtn{
  width:100%;
  margin-top: 10px;
  border: 1px solid rgba(41,212,156,.35);
  background: linear-gradient(135deg, rgba(41,212,156,.35), rgba(124,92,255,.25));
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  font-weight:800;
  cursor:pointer;
  transition: .2s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  position:relative;
}
.primaryBtn:hover{ transform: translateY(-1px); }
.primaryBtn:disabled{ opacity:.6; cursor:not-allowed; transform:none; }

.spinner{
  width:16px; height:16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.95);
  display:none;
  animation: spin .9s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg);} }

.mini{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:center;
  color: var(--muted2);
  font-size: 13px;
}
.linkBtn{
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight:800;
  cursor:pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.meBox{
  margin: 14px 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 12px;
}
.meRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.meRow:last-child{ border-bottom:0; }
.pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--muted);
}
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 13px; }

.actions{
  display:flex;
  gap: 10px;
  margin-top: 10px;
}
.ghostBtn, .dangerBtn{
  flex:1;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight:800;
  cursor:pointer;
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--text);
  transition: .2s ease;
}
.ghostBtn:hover{ background: var(--btn2); transform: translateY(-1px); }
.dangerBtn{
  border-color: rgba(255,92,122,.35);
  background: linear-gradient(135deg, rgba(255,92,122,.35), rgba(255,202,58,.18));
}
.dangerBtn:hover{ transform: translateY(-1px); }

.note{
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 13px;
}

.footer{
  margin-top:auto;
  display:flex;
  justify-content:center;
  gap: 10px;
  color: var(--muted2);
  font-size: 12px;
  padding: 10px 0;
}
.dot{ opacity:.5; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  min-width: min(520px, calc(100% - 24px));
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events:none;
  transition: .18s ease;
}
.toast.show{ opacity: 1; }
.toast.ok{ border-color: rgba(41,212,156,.45); }
.toast.bad{ border-color: rgba(255,92,122,.45); }
.toast.warn{ border-color: rgba(255,202,58,.45); }

@media (max-width: 480px){
  .brandText .sub{ display:none; }
  .panels{ padding: 16px; }
}
