
:root {
  --bg-image: url("/icon/study-background.png");
  --bg-dim: 0;
  --card-w: 640px;

  --cyan: #26e8ff;
  --cyan-line: rgba(38, 232, 255, .38);
  --green: #2bff5a;
  --text: #f1feff;
  --muted: rgba(120, 210, 232, .55);
  --err: #ff6b81;
  --chamfer: 28px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  color: var(--text);
  background-color: #030a12;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--bg-image);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: none;
  opacity: 1;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 84px 16px 56px;
}

.card-glow {
  position: relative;
  width: min(var(--card-w), 100%);
  filter:
    drop-shadow(0 0 5px rgba(38, 232, 255, .7))
    drop-shadow(0 0 26px rgba(38, 232, 255, .28));
}

.card {
  position: relative;
  padding: 124px 50px 40px;
  background: linear-gradient(135deg, #5ff4ff 0%, #19c4e7 50%, #48efff 100%);
  clip-path: polygon(
    var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer),
    100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%,
    var(--chamfer) 100%, 0 calc(100% - var(--chamfer)), 0 var(--chamfer)
  );
}

.card::before {
  content: "";
  position: absolute;
  inset: 3px;
  background:
    radial-gradient(ellipse 60% 26% at 50% 0, rgba(38, 232, 255, .13), transparent 70%),
    linear-gradient(180deg, #041520 0%, #030d15 100%);
  clip-path: polygon(
    calc(var(--chamfer) - 2px) 0, calc(100% - var(--chamfer) + 2px) 0, 100% calc(var(--chamfer) - 2px),
    100% calc(100% - var(--chamfer) + 2px), calc(100% - var(--chamfer) + 2px) 100%,
    calc(var(--chamfer) - 2px) 100%, 0 calc(100% - var(--chamfer) + 2px), 0 calc(var(--chamfer) - 2px)
  );
}

.card__frame {
  position: absolute;
  inset: 11px;
  background: rgba(38, 232, 255, .2);
  clip-path: polygon(
    18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px),
    calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px
  );
}

.card__frame::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: linear-gradient(180deg, #041520 0%, #030d15 100%);
  clip-path: polygon(
    17px 0, calc(100% - 17px) 0, 100% 17px, 100% calc(100% - 17px),
    calc(100% - 17px) 100%, 17px 100%, 0 calc(100% - 17px), 0 17px
  );
}

.badge {
  position: absolute;
  top: -46px;
  left: 50%;
  width: 640px;
  height: 130px;
  transform: translateX(-50%) scale(.68);
  transform-origin: top center;
  z-index: 4;
}

.badge__shield {
  position: absolute;
  top: 0;
  left: 50%;
  width: 104px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 10px rgba(43, 255, 150, .5)) drop-shadow(0 0 6px rgba(38, 232, 255, .65));
}

.badge__ornament {
  position: absolute;
  top: 44px;
  width: 210px;
  height: 58px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 5;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 5px rgba(38, 232, 255, .85));
}

.badge__ornament .thin {
  stroke-width: 2.5;
  opacity: .55;
}

.badge__ornament--l {
  left: 0;
  transform: scaleX(-1);
}

.badge__ornament--r {
  right: 0;
}

.title {
  position: absolute;
  top: 40px;
  left: 50%;
  width: 290px;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}

.title::before,
.title::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 12px;
  height: 46px;
  filter: drop-shadow(0 0 5px rgba(38, 232, 255, .8));
}

.title::before {
  left: 0;
  border-left: 2px solid var(--cyan);
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 100% 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom left / 100% 2px no-repeat;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.title::after {
  right: 0;
  border-right: 2px solid var(--cyan);
  background:
    linear-gradient(var(--cyan), var(--cyan)) top right / 100% 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 100% 2px no-repeat;
}

.title h1 {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.55;
  color: #fff;
  text-shadow: 0 0 12px rgba(180, 245, 255, .4);
}

.title p {
  margin-top: -2px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .5px;
  color: var(--green);
  text-shadow: 0 0 8px rgba(43, 255, 90, .6);
  direction: ltr;
}

.form {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.field {
  position: relative;
}

.field + .field {
  margin-top: 28px;
}

.field label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.ico {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--cyan);
  filter: drop-shadow(0 0 4px rgba(38, 232, 255, .55));
}

.control {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  border: 1px solid var(--cyan-line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 60, 82, .5), rgba(6, 36, 52, .55));
  box-shadow: inset 0 0 14px rgba(38, 232, 255, .06);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.control:hover,
.control:focus-within {
  border-color: var(--cyan-line);
  background: linear-gradient(180deg, rgba(12, 60, 82, .5), rgba(6, 36, 52, .55));
  box-shadow: inset 0 0 14px rgba(38, 232, 255, .06);
}

.control::after {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  right: -1px;
  width: 4px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(38, 232, 255, .25), #46f1ff);
  box-shadow: 0 0 8px rgba(38, 232, 255, .5);
  opacity: .45;
  transition: width .25s, opacity .25s;
  pointer-events: none;
}

.control:focus-within::after {
  width: 4px;
  opacity: .45;
  box-shadow: 0 0 8px rgba(38, 232, 255, .5);
}

.control input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 24px 0 18px;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .5px;
  text-align: left;
}

.control input:focus,
.control input:focus-visible {
  outline: none;
  box-shadow: none;
}

.control input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.control input[type="password"] {
  letter-spacing: 3px;
  font-weight: 700;
}

.control input[type="password"]::placeholder {
  letter-spacing: 3px;
}

.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus,
.control input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #08283a inset !important;
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s;
}

.eye {
  flex: none;
  width: 38px;
  height: 38px;
  margin-right: 14px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--cyan);
  cursor: pointer;
  transition: background .2s;
  z-index: 1;
}

.eye .ico {
  width: 24px;
  height: 24px;
}

.eye:hover {
  background: rgba(38, 232, 255, .12);
}

.err {
  position: absolute;
  top: 100%;
  right: 2px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--err);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .2s, transform .2s;
}

.field.invalid .control {
  border-color: var(--err);
  box-shadow: 0 0 12px rgba(255, 107, 129, .3);
}

.field.invalid .control::after {
  background: linear-gradient(90deg, rgba(255, 107, 129, .3), var(--err));
  box-shadow: 0 0 8px rgba(255, 107, 129, .6);
}

.field.invalid .err {
  opacity: 1;
  transform: none;
}

.submit-row {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 24px -14px 0;
}

.submit-row::before,
.submit-row::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 44px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(43, 255, 90, .8));
  box-shadow: 0 0 6px rgba(43, 255, 90, .5);
}

.submit-row::before {
  left: 0;
  transform: translateY(-50%);
}

.submit-row::after {
  right: 0;
  transform: translateY(-50%) scaleX(-1);
}

.btn-submit {
  position: relative;
  width: 480px;
  max-width: 100%;
  height: 90px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #63ff8a, #1fe04c 50%, #52ff7e);
  clip-path: polygon(30px 0, calc(100% - 30px) 0, 100% 30px, 100% calc(100% - 30px), calc(100% - 30px) 100%, 30px 100%, 0 calc(100% - 30px), 0 30px);
  filter: drop-shadow(0 0 10px rgba(43, 255, 90, .75));
  transition: filter .2s, transform .1s;
}

.btn-submit::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: #041f10;
  clip-path: polygon(28px 0, calc(100% - 28px) 0, 100% 28px, 100% calc(100% - 28px), calc(100% - 28px) 100%, 28px 100%, 0 calc(100% - 28px), 0 28px);
}

.btn-submit::after {
  content: "";
  position: absolute;
  inset: 10px 12px;
  background:
    radial-gradient(ellipse 60% 110% at 50% 50%, rgba(28, 150, 60, .55), transparent 80%),
    linear-gradient(180deg, #08461f 0%, #043016 55%, #052812 100%);
  clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 22px, 100% calc(100% - 22px), calc(100% - 22px) 100%, 22px 100%, 0 calc(100% - 22px), 0 22px);
  box-shadow: inset 0 0 0 2px rgba(60, 255, 110, .55);
  transition: background .2s;
}

.btn-submit__inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-submit__text {
  font-size: 22px;
  font-weight: 800;
  color: #f4fff6;
  text-shadow: 0 0 12px rgba(43, 255, 90, .75);
}

.btn-submit__ico {
  width: 26px;
  height: 26px;
  color: #eafff0;
  filter: drop-shadow(0 0 5px rgba(43, 255, 90, .9));
}

.btn-submit:hover {
  filter: drop-shadow(0 0 16px rgba(43, 255, 90, 1));
}

.btn-submit:hover::after {
  background:
    radial-gradient(ellipse 60% 110% at 50% 50%, rgba(40, 190, 80, .6), transparent 80%),
    linear-gradient(180deg, #0b5a28 0%, #06401d 55%, #06331a 100%);
}

.btn-submit:active {
  transform: translateY(1px);
}

.btn-submit:disabled {
  filter: saturate(.4) brightness(.7);
  cursor: progress;
}

.links {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 16px;
  font-size: 15.5px;
  font-weight: 500;
}

.links a {
  color: #3cefff;
  text-decoration: none;
  text-shadow: 0 0 8px rgba(38, 232, 255, .45);
  transition: color .2s, text-shadow .2s;
}

.links a:hover {
  color: #a5fbff;
  text-shadow: 0 0 14px rgba(38, 232, 255, .9);
}

.links__sep {
  width: 1px;
  height: 22px;
  background: rgba(38, 232, 255, .55);
}

.platform,
.holo,
.glow-ring,
.elliptical-glow {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

:focus-visible {
  outline: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  border: 1px solid var(--cyan-line);
  border-radius: 8px;
  background: rgba(4, 19, 30, .95);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: 0 0 20px rgba(38, 232, 255, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: var(--err);
  box-shadow: 0 0 20px rgba(255, 107, 129, .3);
}

.row {
  display: flex;
  gap: 8px;
  height: 50px;
}

.row .control {
  flex: 1;
  min-width: 0;
}

.row .control::after {
  display: none;
}

.btn-code {
  flex: none;
  width: 140px;
  height: 100%;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #52f2ff 0%, #1ccbee 100%);
  color: #052a3b;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(38, 232, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: filter .2s, transform .1s;
}

.btn-code .ico {
  color: #052a3b;
  filter: none;
  width: 22px;
  height: 22px;
}

.btn-code:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-code:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-code:disabled {
  cursor: not-allowed;
  filter: saturate(.45) brightness(.7);
  box-shadow: none;
}

.control--otp input {
  letter-spacing: 8px;
  font-weight: 700;
}

.control--otp input::placeholder {
  letter-spacing: 6px;
}

.timer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 22px 0 4px;
  direction: ltr;
}

.timer .ico {
  width: 20px;
  height: 20px;
}

.timer b {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #33ff6a;
  text-shadow: 0 0 8px rgba(43, 255, 90, .55);
  font-variant-numeric: tabular-nums;
}

.timer.expired b {
  color: var(--err);
  text-shadow: 0 0 8px rgba(255, 107, 129, .45);
}

@media (max-width: 560px) {
  .stage {
    padding-top: 76px;
  }
  .card {
    --chamfer: 22px;
    padding: 118px 20px 34px;
  }
  .card__frame {
    inset: 8px;
  }
  .badge {
    transform: translateX(-50%) scale(.6);
    top: -40px;
  }
  .badge__ornament {
    display: none;
  }
  .title {
    top: 36px;
    width: 250px;
  }
  .title h1 {
    font-size: 23px;
  }
  .title p {
    font-size: 15px;
  }
  .field label {
    font-size: 14px;
  }
  .control {
    height: 48px;
  }
  .control input {
    font-size: 16px;
  }
  .submit-row {
    margin-inline: 0;
  }
  .submit-row::before,
  .submit-row::after {
    display: none;
  }
  .btn-submit {
    width: 100%;
    height: 76px;
  }
  .btn-submit__text {
    font-size: 18px;
  }
  .links {
    gap: 16px;
    font-size: 14px;
  }
  .btn-code {
    width: 116px;
    font-size: 14.5px;
  }
  .timer b {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
