/* Sign in / sign up — same lab palette as chem.css.
   The page keeps dir="ltr" because sign.js slides the forms with margin-left. */
:root {
  --bg: #06100c;
  --surface: #0e1f17;
  --surface-2: #132a1f;
  --line: rgba(160, 255, 200, 0.11);
  --line-strong: rgba(160, 255, 200, 0.24);
  --text: #eaf6ee;
  --muted: #93ab9e;
  --green: #35e08a;
  --green-ink: #04140c;
  --yellow: #ffe100;
  --danger: #ff5d5d;
  --font-display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 28px 16px;
  background-color: var(--bg);
  background-image:
    radial-gradient(700px 420px at 50% 0%, rgba(53, 224, 138, 0.16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0v16.2L0 32.3v32.4L28 80.8v16.2M28 16.2l28 16.1v32.4L28 80.8' fill='none' stroke='%2335e08a' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  direction: ltr;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
}

.tile {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 0.3em;
  background: var(--green);
  color: var(--green-ink);
  line-height: 1;
}

.tile.s {
  background: var(--yellow);
  color: #171400;
}

.tile > i {
  position: absolute;
  top: 0.22em;
  left: 0.28em;
  font-size: 0.34em;
  font-style: normal;
  font-weight: 500;
}

.tile > b {
  font-size: 0.92em;
  transform: translateY(0.08em);
}

.tile + span {
  margin: 0 9px 0 2px;
  padding-bottom: 2px;
}

.wrapper {
  width: 100%;
  max-width: 420px;
  padding: 28px 22px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.wrapper .title-text {
  display: flex;
  width: 200%;
}

.wrapper .title {
  width: 50%;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  text-align: center;
  transition: margin 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.wrapper .slide-controls {
  position: relative;
  display: flex;
  height: 52px;
  margin: 22px 0 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  overflow: hidden;
}

.slide-controls .slide {
  flex: 1;
  display: grid;
  place-items: center;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.slide-controls .slider-tab {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--green);
  transition: left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

input[type="radio"] {
  display: none;
}

#signup:checked ~ .slider-tab {
  left: 50%;
}

#login:checked ~ label.login,
#signup:checked ~ label.signup {
  color: var(--green-ink);
  cursor: default;
}

.wrapper .form-container {
  width: 100%;
  overflow: hidden;
}

.form-container .form-inner {
  display: flex;
  width: 200%;
  align-items: flex-start;
}

.form-container .form-inner form {
  width: 50%;
  padding: 2px;
  transition: margin 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.form-inner form .field {
  margin-top: 14px;
}

.form-inner form .field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming on focus */
  direction: rtl;
  text-align: right;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-inner form .field input::placeholder {
  color: var(--muted);
}

.form-inner form .field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(53, 224, 138, 0.18);
}

.form-inner form .signup-link {
  margin-top: 18px;
  text-align: center;
  direction: rtl;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-inner form .signup-link a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

form .btn {
  position: relative;
  height: 52px;
  margin-top: 20px;
  border-radius: 999px;
  overflow: hidden;
}

form .btn .btn-layer {
  position: absolute;
  inset: 0;
  background: var(--green);
  transition: background-color 0.2s;
}

form .btn:hover .btn-layer {
  background: #5bf0a4;
}

form .field.btn input[type="submit"] {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green-ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
}

.error {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 6px;
  margin-top: 6px;
  direction: ltr;
}

.error-message {
  flex: 1;
  color: var(--danger);
  font-size: 0.82rem;
  direction: rtl;
  text-align: right;
}

.gg-danger {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--danger);
  border-radius: 50%;
  color: var(--danger);
}

.gg-danger::after,
.gg-danger::before {
  content: "";
  position: absolute;
  left: 6px;
  width: 2px;
  border-radius: 3px;
  background: currentColor;
}

.gg-danger::after {
  top: 2px;
  height: 6px;
}

.gg-danger::before {
  bottom: 2px;
  height: 2px;
}

.wrappeer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 10px 6px;
}

.animated-check {
  width: 84px;
  height: 84px;
  padding: 16px;
  border-radius: 50%;
  background: rgba(53, 224, 138, 0.14);
}

.animated-check path {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 23;
  stroke-dashoffset: 23;
  animation: draw 0.8s ease forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.created {
  color: var(--muted);
  text-align: center;
  direction: rtl;
}

.spinner {
  display: flex;
  justify-content: center;
  padding: 26px 0 6px;
}

.loader {
  width: 54px;
  aspect-ratio: 1;
  --_c: no-repeat radial-gradient(farthest-side, #35e08a 92%, #0000);
  background: var(--_c) top, var(--_c) left, var(--_c) right, var(--_c) bottom;
  background-size: 11px 11px;
  animation: l7 1s infinite;
}

@keyframes l7 {
  to {
    transform: rotate(0.5turn);
  }
}

.back-home {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  direction: rtl;
}

.back-home:hover {
  color: var(--green);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
