:root {
  --bg: #050705;
  --panel: rgba(13, 17, 14, 0.9);
  --panel-strong: rgba(18, 24, 20, 0.95);
  --line: rgba(140, 255, 198, 0.18);
  --line-strong: rgba(127, 255, 212, 0.42);
  --text: #edf7ef;
  --muted: #8f9f96;
  --cyan: #6fffe9;
  --green: #61ff9d;
  --amber: #f7c95f;
  --red: #ff5c7a;
  --shadow: rgba(0, 0, 0, 0.45);
  --radius: 8px;
}

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

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  padding: 32px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-family: "Courier New", monospace;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  background:
    linear-gradient(135deg, rgba(5, 7, 5, 0.96), rgba(19, 22, 17, 0.98)),
    repeating-linear-gradient(90deg, rgba(111, 255, 233, 0.06) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(247, 201, 95, 0.035) 0 1px, transparent 1px 44px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(97, 255, 157, 0.08) 50%, transparent 52%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: 0.42;
  z-index: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(111, 255, 233, 0.05), transparent 25%, transparent 75%, rgba(247, 201, 95, 0.04)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.72));
}

.overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(111, 255, 233, 0.11), transparent);
  transform: translateY(-100%);
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  to {
    transform: translateY(100%);
  }
}

.login-container,
.account-container {
  width: min(100%, 520px);
  position: relative;
  z-index: 2;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 36%),
    var(--panel);
  box-shadow:
    0 26px 70px var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.login-container::before,
.login-container::after,
.account-container::before,
.account-container::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--line-strong);
  border-style: solid;
  pointer-events: none;
}

.login-container::before,
.account-container::before {
  top: 12px;
  left: 12px;
  border-width: 1px 0 0 1px;
}

.login-container::after,
.account-container::after {
  right: 12px;
  bottom: 12px;
  border-width: 0 1px 1px 0;
}

h1 {
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 18px;
}

.security-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 26px;
}

.security-strip span {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid rgba(111, 255, 233, 0.22);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(111, 255, 233, 0.045);
  font-size: 0.72rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--amber);
  font-size: 0.95rem;
  z-index: 1;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 13px 44px;
  border: 1px solid rgba(143, 159, 150, 0.25);
  border-radius: 6px;
  outline: none;
  background: rgba(3, 6, 4, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
  color: rgba(143, 159, 150, 0.62);
}

input:focus {
  border-color: var(--cyan);
  background: rgba(4, 9, 7, 0.95);
  box-shadow: 0 0 0 3px rgba(111, 255, 233, 0.1);
}

.idkey-input {
  font-size: 0.76rem;
  letter-spacing: 0;
}

.paste-btn,
.login-btn,
.create-btn,
.copy-btn,
.login-link-btn {
  min-height: 44px;
  border: 1px solid rgba(97, 255, 157, 0.42);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(97, 255, 157, 0.16), rgba(97, 255, 157, 0.06)),
    rgba(5, 8, 6, 0.92);
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-btn,
.create-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  text-transform: uppercase;
}

.paste-btn,
.copy-btn {
  margin-top: 10px;
  padding: 9px 12px;
  font-size: 0.82rem;
}

.login-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  margin-top: 18px;
}

.paste-btn:hover,
.login-btn:hover,
.create-btn:hover,
.copy-btn:hover,
.login-link-btn:hover {
  transform: translateY(-1px);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(97, 255, 157, 0.1), 0 14px 34px rgba(0, 0, 0, 0.28);
}

.login-btn.loading,
.create-btn.loading,
.create-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.toggle-password {
  position: absolute;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.toggle-password:hover {
  color: var(--cyan);
}

.password-strength {
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(143, 159, 150, 0.16);
}

.strength-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.2s ease, background 0.2s ease;
}

.strength-text,
.match-indicator small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.link-text {
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.link-text a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
}

.link-text a:hover {
  color: var(--green);
}

.info-box {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(247, 201, 95, 0.22);
  border-left-color: var(--amber);
  border-radius: 6px;
  background: rgba(247, 201, 95, 0.055);
  text-align: left;
}

.info-box p {
  color: #d8d0af;
  font-size: 0.8rem;
}

.info-box p + p {
  margin-top: 7px;
}

.account-created {
  display: none;
  text-align: center;
}

.success-message {
  color: var(--green);
  font-weight: 700;
  margin-bottom: 16px;
}

.idkey-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.idkey-display {
  max-height: 150px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(3, 6, 4, 0.75);
  color: var(--cyan);
  font-size: 0.76rem;
  text-align: left;
  word-break: break-all;
}

.warning-text {
  margin-top: 14px;
  color: var(--amber);
  font-size: 0.86rem;
  font-weight: 700;
}

.description-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.error-message {
  display: none;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid rgba(255, 92, 122, 0.38);
  border-radius: 6px;
  background: rgba(255, 92, 122, 0.08);
  color: var(--red);
  font-size: 0.88rem;
}

#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 0.84rem;
  box-shadow: 0 18px 42px var(--shadow);
  opacity: 0;
  transform: translateX(120%);
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

@media (max-width: 560px) {
  body {
    padding: 18px 12px;
    align-items: flex-start;
  }

  .login-container,
  .account-container {
    padding: 26px 18px;
  }

  h1 {
    font-size: 1.72rem;
  }

  .security-strip {
    grid-template-columns: 1fr;
  }

  input {
    font-size: 0.9rem;
  }
}

@media (max-height: 620px) and (min-width: 720px) {
  body {
    align-items: flex-start;
  }
}
