:root {
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --card-bg: rgba(255, 255, 255, 0.14);
  --card-border: rgba(255, 255, 255, 0.22);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.18);
  --button-bg: linear-gradient(135deg, #60a5fa, #2563eb);
  --button-bg-hover: linear-gradient(135deg, #7cb6ff, #1d4ed8);
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #1d4ed8 0%, transparent 35%),
    radial-gradient(circle at bottom right, #0ea5e9 0%, transparent 30%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

.background-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.28;
  pointer-events: none;
  animation: floatGlow 8s ease-in-out infinite;
}

.glow-1 {
  width: 260px;
  height: 260px;
  background: #60a5fa;
  top: 8%;
  left: 8%;
}

.glow-2 {
  width: 320px;
  height: 320px;
  background: #22d3ee;
  right: 6%;
  bottom: 8%;
  animation-delay: -4s;
}

.card {
  position: relative;
  width: min(100%, 560px);
  padding: 34px;
  border-radius: 28px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: cardIn 0.7s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.85rem;
  color: #dbeafe;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 4vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  margin: 0 0 28px;
  font-size: clamp(0.98rem, 2.8vw, 1rem);
  line-height: 1.65;
  color: var(--muted);
  word-break: normal;
}

.password-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  font-size: 0.95rem;
  color: #e2e8f0;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 10px 10px 16px;
  border-radius: 18px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.input-row:focus-within {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow:
    0 0 0 4px rgba(96, 165, 250, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#passwordField {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    opacity 0.18s ease,
    filter 0.18s ease;
}

#passwordField.reveal-change {
  opacity: 0.72;
  filter: blur(0.6px);
}

#passwordField::selection {
  background: rgba(96, 165, 250, 0.35);
}

.icon-btn {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.icon-btn:active {
  transform: scale(0.93);
}

.eye-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    opacity 0.22s ease,
    transform 0.28s ease;
}

.eye-open {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.eye-closed {
  opacity: 0;
  transform: scale(0.65) rotate(-12deg);
}

.icon-btn.active .eye-open {
  opacity: 0;
  transform: scale(0.65) rotate(12deg);
}

.icon-btn.active .eye-closed {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.copy-btn {
  position: relative;
  min-height: 58px;
  width: 100%;
  border: none;
  border-radius: 18px;
  background: var(--button-bg);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 12px 30px rgba(37, 99, 235, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

.copy-btn:hover {
  transform: translateY(-2px);
  background: var(--button-bg-hover);
  box-shadow:
    0 16px 34px rgba(37, 99, 235, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.copy-btn:active {
  transform: scale(0.97);
}

.copy-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transform: skewX(-20deg);
}

.copy-btn:hover::before {
  animation: shine 0.8s ease;
}

.copy-btn-text,
.copy-btn-success {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 14px;
  text-align: center;
  transition:
    transform 0.28s ease,
    opacity 0.22s ease;
}

.copy-btn-success {
  opacity: 0;
  transform: translateY(16px) scale(0.95);
}

.copy-btn.copied {
  background: linear-gradient(135deg, #34d399, #16a34a);
  box-shadow:
    0 14px 32px rgba(34, 197, 94, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.copy-btn.copied .copy-btn-text {
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
}

.copy-btn.copied .copy-btn-success {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.copy-btn.pop {
  animation: copyPop 0.35s ease;
}

.status {
  min-height: 1.2em;
  font-size: 0.95rem;
  color: #bbf7d0;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.status.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatGlow {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  50% {
    transform: translateY(-18px) translateX(10px) scale(1.06);
  }
}

@keyframes copyPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shine {
  from {
    left: -120%;
  }
  to {
    left: 140%;
  }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }

  .card {
    width: 100%;
    max-width: 560px;
    padding: 26px;
    border-radius: 24px;
  }

  .glow-1 {
    width: 220px;
    height: 220px;
  }

  .glow-2 {
    width: 240px;
    height: 240px;
  }
}

@media (max-width: 520px) {
  body {
    padding: 12px;
    min-height: 100svh;
  }

  .card {
    width: 100%;
    max-width: 560px;
    padding: 22px 18px;
    border-radius: 22px;
  }

  .badge {
    margin-bottom: 14px;
    font-size: 0.8rem;
  }

  h1 {
    margin-bottom: 10px;
    font-size: 1.55rem;
  }

  p {
    margin-bottom: 22px;
    font-size: 0.97rem;
    line-height: 1.55;
  }

  .password-wrapper {
    gap: 12px;
  }

  .input-row {
    min-height: 58px;
    padding: 8px 8px 8px 14px;
    border-radius: 16px;
  }

  #passwordField {
    font-size: 0.98rem;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .copy-btn {
    min-height: 54px;
    border-radius: 16px;
    font-size: 0.98rem;
  }

  .status {
    font-size: 0.9rem;
  }

  .background-glow {
    opacity: 0.18;
  }
}

@media (max-width: 360px) {
  body {
    padding: 10px;
    min-height: 100svh;
  }

  .card {
    padding: 18px 14px;
  }

  h1 {
    font-size: 1.4rem;
  }

  p {
    font-size: 0.93rem;
  }

  #passwordField {
    font-size: 0.92rem;
  }

  .copy-btn {
    font-size: 0.94rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}