﻿@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&display=swap");

:root {
  --bg-a: #0b2629;
  --bg-b: #123f46;
  --bg-c: #f29936;
  --text: #f5f8f4;
  --muted: #d4ddd5;
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.24);
  --input-bg: rgba(2, 13, 15, 0.38);
  --accent: #3cc7bc;
  --accent-warm: #ffbf69;
  --danger: #ff6f61;
  --warn: #ffd166;
  --ok: #62d99a;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(130deg, var(--bg-a), var(--bg-b) 50%, var(--bg-c));
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: absolute;
  inset: -30vmax;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 191, 105, 0.26), transparent 40%),
    radial-gradient(circle at 78% 60%, rgba(60, 199, 188, 0.2), transparent 45%),
    radial-gradient(circle at 60% 22%, rgba(255, 255, 255, 0.15), transparent 30%);
  animation: drift 18s linear infinite;
}

body::after {
  background: conic-gradient(from 90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.08));
  filter: blur(34px);
  animation: spin 24s linear infinite;
}

.password-app {
  width: min(92vw, 560px);
  z-index: 1;
}

.card {
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
  box-shadow:
    0 24px 60px rgba(5, 14, 16, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  animation: card-in 700ms cubic-bezier(0.17, 0.84, 0.44, 1);
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.84);
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.55rem, 4.2vw, 2.2rem);
  line-height: 1.15;
}

.intro {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

#passwordInput,
#passwordOutput {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 1.02rem;
  line-height: 1.3;
  padding: 14px 15px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

#passwordInput::placeholder,
#passwordOutput::placeholder {
  color: rgba(223, 232, 225, 0.75);
}

#passwordInput:focus-visible,
#passwordOutput:focus-visible {
  outline: none;
  border-color: rgba(255, 191, 105, 0.95);
  box-shadow: 0 0 0 4px rgba(255, 191, 105, 0.2);
}

#passwordOutput {
  margin-top: 10px;
}

#passwordOutput.is-updated {
  animation: output-pulse 420ms ease;
}

.result-head {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  padding: 7px 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-empty {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
}

.badge-zayif {
  background: rgba(255, 111, 97, 0.22);
  border-color: rgba(255, 111, 97, 0.55);
}

.badge-orta {
  background: rgba(255, 209, 102, 0.22);
  border-color: rgba(255, 209, 102, 0.55);
}

.badge-guclu {
  background: rgba(98, 217, 154, 0.22);
  border-color: rgba(98, 217, 154, 0.62);
}

.reasons {
  margin: 12px 2px 0;
  min-height: 2.2em;
  color: rgba(234, 241, 235, 0.9);
  line-height: 1.45;
  font-size: 0.9rem;
}

.actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

#copyBtn {
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  color: #052025;
  background: linear-gradient(120deg, var(--accent), var(--accent-warm));
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

#copyBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  filter: saturate(1.08);
}

#copyBtn:active:not(:disabled) {
  transform: translateY(0);
}

#copyBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 10px;
  padding: 10px 14px;
  color: #0f2022;
  background: rgba(238, 248, 242, 0.96);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  transition: transform 220ms ease, opacity 220ms ease;
  z-index: 2;
}

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

.toast.error {
  background: rgba(255, 232, 228, 0.97);
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4%, -3%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes card-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes output-pulse {
  0% {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
  }
  55% {
    border-color: rgba(60, 199, 188, 0.95);
    box-shadow: 0 0 0 4px rgba(60, 199, 188, 0.25);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  body {
    padding: 14px;
  }

  .card {
    padding: 18px;
    border-radius: 16px;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .badge {
    min-width: 86px;
  }

  #copyBtn {
    width: 100%;
  }

  .actions {
    justify-content: stretch;
  }
}

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