/* ==== Root ==== */
:root {
  --font-family-base: "Vazir", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --primary-color: #66c0f4;
  --secondary-color: #a8d0ff;
  --accent-color: #7c5cff;
  --success-color: #3ddc97;
  --warning-color: #ffcc66;
  --danger-color: #ff4d6d;

  --bg-0: #0b101a;
  --bg-2: #0f1a2b;
  --bg-3: #14233a;

  --text-1: #eaf2ff;
  --text-2: rgba(234, 242, 255, 0.75);
  --text-3: rgba(234, 242, 255, 0.55);

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow-primary: 0 0 0 1px rgba(102, 192, 244, 0.25), 0 0 28px rgba(102, 192, 244, 0.18);

  --radius-xl: 28px;
  --tabs-pad: 6px;
}

@font-face {
  font-family: "Vazir";
  src: url("../Fonts/Vazir.woff2") format("woff2"),
       url("../Fonts/Vazir.woff") format("woff"),
       url("../Fonts/Vazir.ttf") format("truetype"),
       url("../Fonts/Vazir.eot") format("embedded-opentype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== Base ===== */
*{ box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  font-family: var(--font-family-base);
  color: var(--text-1);
  overflow-x: hidden;

  background:
    radial-gradient(1100px 680px at 12% 10%, rgba(102,192,244,0.14), transparent 55%) fixed,
    radial-gradient(900px 620px at 88% 25%, rgba(124,92,255,0.12), transparent 58%) fixed,
    linear-gradient(180deg, var(--bg-3), var(--bg-2) 40%, var(--bg-0)) fixed;
}

a{ color: inherit; text-decoration: none; }

:focus-visible{
  outline: 2px solid rgba(102,192,244,0.55);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ===== Background Decor ==== */
.auth-bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.glow{
  position: absolute;
  filter: blur(44px);
  opacity: 0.78;
  transform: translateZ(0);
  animation: floaty 10s ease-in-out infinite;
}

.glow.g1{
  width: 520px; height: 520px;
  right: -160px; top: -180px;
  background: radial-gradient(circle at 30% 30%, rgba(102,192,244,0.35), transparent 65%);
  animation-duration: 11s;
}
.glow.g2{
  width: 560px; height: 560px;
  left: -200px; bottom: -220px;
  background: radial-gradient(circle at 40% 40%, rgba(124,92,255,0.30), transparent 65%);
  animation-duration: 13s;
}
.glow.g3{
  width: 380px; height: 380px;
  left: 18%; top: 12%;
  background: radial-gradient(circle at 40% 40%, rgba(168,208,255,0.18), transparent 70%);
  animation-duration: 9s;
}

.grid{
  position: absolute;
  inset: -40px;
  opacity: 0.12;
  background:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0 55%, transparent 75%);
  animation: drift 14s linear infinite;
}

/* ===== Layout ===== */
.auth-wrap{
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 26px 14px;
  position: relative;
  z-index: 1;
}

.auth-shell{
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
  animation: popIn .55s cubic-bezier(.2,.9,.2,1) both;
}

.auth-shell{
  position: relative;
}
.auth-shell::after{
  content:"";
  position:absolute;
  inset:-24px;
  border-radius: 34px;
  background: radial-gradient(600px 200px at 50% 0%, rgba(102,192,244,0.10), transparent 70%);
  pointer-events:none;
  opacity:.9;
  animation: breathe 5.5s ease-in-out infinite;
}

/* ===== Tabs ===== */
.auth-tabs{
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: var(--tabs-pad);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
}

.tab{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-weight: 950;
  padding: 12px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: color .2s, transform .2s;
  position: relative;
  z-index: 1;
}
.tab:hover{ transform: translateY(-1px); color: var(--text-1); }
.tab.is-active{ color: #07101f; }

.tab-indicator{
  position: absolute;
  top: var(--tabs-pad);
  bottom: var(--tabs-pad);
  right: var(--tabs-pad);
  width: calc(50% - 4px);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(102,192,244,0.95), rgba(102,192,244,0.55));
  box-shadow: var(--shadow-glow-primary);
  transform: translateX(0%);
  transition: transform .35s cubic-bezier(.2,.9,.2,1);
}
.auth-tabs[data-active="register"] .tab-indicator{ transform: translateX(-100%); }

/* ===== Alerts ===== */
.auth-alerts-layer{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}
.auth-alerts{
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.alert{
  pointer-events: auto;
  display: grid;
  grid-template-columns: 22px 1fr 32px;
  align-items: start;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(18, 27, 46, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 50px rgba(0,0,0,0.38);

  animation: toastIn .34s cubic-bezier(.2,.95,.2,1) both;
  transform-origin: top right;
}
.alert.is-leaving{
  animation: toastOut .24s ease both;
}

.alert i{ margin-top: 2px; }
.alert-title{ font-weight: 950; margin-bottom: 2px; }
.alert-text{ color: var(--text-2); line-height: 1.9; font-size: .95rem; }

.alert-close{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  width: 32px; height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.alert-close:hover{
  background: rgba(255,255,255,0.08);
  color: var(--text-1);
  transform: translateY(-1px);
}

.alert-error{ border-color: rgba(255, 0, 47, 0.5); }
.alert-error > i{ color: var(--danger-color); }

.alert-warn{ border-color: rgba(255, 186, 11, 0.75); }
.alert-warn > i{ color: var(--warning-color); }

.alert-succes{ border-color: rgba(0, 255, 145, 0.75); }
.alert-succes > i{ color: var(--success-color); }

/* ===== Modals ===== */
.auth-modal{
  border-radius: var(--radius-xl);
  background: rgba(18, 27, 46, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 70px rgba(0,0,0,0.45);
  overflow: hidden;
  position: relative;
  max-height: min(72vh, 620px);
}

.auth-modal::before{
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(900px 400px at 70% 0%, rgba(102,192,244,0.16), transparent 60%),
    radial-gradient(800px 380px at 20% 110%, rgba(124,92,255,0.14), transparent 60%);
  pointer-events: none;
}

.panel{
  position: relative;
  padding: 16px 16px 14px 16px;
  display: none;
  animation: fadeUp .34s cubic-bezier(.2,.9,.2,1) both;

  overflow: auto;
  max-height: inherit;

  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(102,192,244,0.55) rgba(255,255,255,0.06);
}
.panel::-webkit-scrollbar{ width: 8px; }
.panel::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
.panel::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(102,192,244,0.7), rgba(124,92,255,0.45));
  border-radius: 999px;
  border: 2px solid rgba(18,27,46,0.65);
}
.panel::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(102,192,244,0.85), rgba(124,92,255,0.6));
}

.panel.is-active{ display: block; }

.panel-title{
  margin: 0 0 6px 0;
  font-weight: 980;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
}
.panel-sub{
  margin: 0 0 12px 0;
  color: var(--text-2);
  line-height: 1.9;
  font-size: .95rem;
}

/* ===== Fields ===== */
.field{ margin-bottom: 10px; }
.label{
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-weight: 850;
  font-size: .92rem;
}

.control{
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;

  padding: 11px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.control:focus-within{
  border-color: rgba(102,192,244,0.35);
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-1px);
}
.control > i{ color: rgba(168,208,255,0.95); }

.control input{
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-1);
  font-size: 1rem;
}
.control input::placeholder{ color: rgba(234,242,255,0.40); }

.icon-btn{
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
  border: 1px solid rgba(255,255,255,0.10);
}
.icon-btn:hover{
  transform: translateY(-1px);
  color: var(--text-1);
  background: rgba(255,255,255,0.06);
  border-color: rgba(102,192,244,0.28);
}

.hint{
  margin-top: 6px;
  color: var(--text-3);
  font-size: .88rem;
  min-height: 1.1em;
}
.hint.ok{ color: rgba(61,220,151,0.95); }
.hint.bad{ color: rgba(255,77,109,0.95); }

/* ===== Strength ===== */
.strength{
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
  margin-top: 8px;
}
.strength .bar{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width .25s ease;
  background: linear-gradient(90deg, rgba(255,77,109,0.9), rgba(255,204,102,0.9), rgba(61,220,151,0.9));
  box-shadow: 0 0 22px rgba(102,192,244,0.15);
}
.strength .strength-text{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 950;
  letter-spacing: -0.02em;
  font-size: .88rem;
  color: rgb(255, 255, 255);
  text-shadow: 0 1px 0 rgb(0, 0, 0);
  pointer-events: none;
}

/* ===== Row / checkbox ===== */
.row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 10px 0;
}

.check{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  font-weight: 850;
}

.check-input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.check-box{
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12) inset;
  display: grid;
  place-items: center;
  transition: transform .15s, border-color .2s, background .2s, box-shadow .2s;
}

.check-box::after{
  content: "";
  width: 9px;
  height: 5px;
  border-left: 3px solid rgba(7,16,31,0.95);
  border-bottom: 3px solid rgba(7,16,31,0.95);
  transform: rotate(-45deg) scale(0.2);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.check-input:focus-visible + .check-box{
  outline: 2px solid rgba(102,192,244,0.55);
  outline-offset: 3px;
}

.check-input:checked + .check-box{
  background: linear-gradient(135deg, rgba(102,192,244,0.95), rgba(102,192,244,0.55));
  border-color: rgba(102,192,244,0.45);
  box-shadow: 0 0 0 1px rgba(102,192,244,0.22), 0 10px 28px rgba(102,192,244,0.14);
  transform: translateY(-1px);
}
.check-input:checked + .check-box::after{
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.check-text{ line-height: 1.9; }

/* ==== Terms ==== */
.terms-link{
  color: var(--primary-color);
  font-weight: 950;
  transition: color .2s, transform .2s;
}
.terms-link:hover{
  color: #9ad8ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== Links / Buttons ===== */
.link{
  color: var(--secondary-color);
  font-weight: 900;
  transition: color .2s;
}
.link:hover{ color: var(--primary-color); }

.btn-steam{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 950;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
.btn-steam:active{ transform: translateY(1px); }

.btn-primary-steam{
  background: linear-gradient(135deg, rgba(102,192,244,0.95), rgba(102,192,244,0.55));
  color: #07101f;
  box-shadow: var(--shadow-glow-primary);
}
.btn-primary-steam:hover{
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(102,192,244,0.35), 0 18px 55px rgba(102,192,244,0.18);
}

.btn-ghost-steam{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  color: var(--text-1);
}
.btn-ghost-steam:hover{
  transform: translateY(-2px);
  border-color: rgba(102,192,244,0.35);
  box-shadow: var(--shadow-soft);
}

.btn-block{ width: 100%; }

/* OR */
.or{
  display: grid;
  place-items: center;
  margin: 10px 0;
  color: var(--text-3);
  position: relative;
}
.or::before{
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255,255,255,0.10);
}
.or span{
  position: relative;
  padding: 0 10px;
  background: rgba(18, 27, 46, 0.50);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  font-weight: 950;
  font-size: .9rem;
}

.fineprint{
  margin: 10px 0 0 0;
  color: var(--text-3);
  line-height: 1.9;
  font-size: .9rem;
}

/* ===== Footer ===== */
.auth-foot{
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-3);
  padding: 4px 6px;
}
.dot{ opacity: .6; }

/* ===== Animations ===== */
@keyframes popIn{
  from{ opacity: 0; transform: translateY(10px) scale(0.985); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}
@keyframes floaty{
  0%{ transform: translateY(0) translateX(0); }
  50%{ transform: translateY(12px) translateX(-10px); }
  100%{ transform: translateY(0) translateX(0); }
}
@keyframes drift{
  from{ transform: translate3d(0,0,0); }
  to{ transform: translate3d(44px, 44px, 0); }
}
@keyframes breathe{
  0%,100%{ opacity: .75; transform: translateY(0); }
  50%{ opacity: 1; transform: translateY(-6px); }
}

@keyframes toastIn{
  from{ opacity: 0; transform: translateY(-10px) scale(.98); filter: blur(2px); }
  to{ opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes toastOut{
  from{ opacity: 1; transform: translateY(0) scale(1); }
  to{ opacity: 0; transform: translateY(-10px) scale(.98); }
}

/* ===== Responsive ===== */
@media (max-width: 576px){
  .panel{ padding: 14px 12px 12px 12px; }
  .control{ border-radius: 16px; }
  .btn-steam{ padding: 11px 12px; border-radius: 12px; }
  .grid{ opacity: 0.08; }

  .auth-alerts-layer{
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}
