:root {
  --bg-start: #f3e7e9; /* Warna soft baru */
  --bg-end: #e3eeff; /* Warna soft baru */
  --card-bg: rgba(255, 255, 255, 0.45);
  --primary-text: #2c3e50;
  --secondary-text: #5a6a85;
  --accent-color: #5d5fef;
  --accent-gradient: linear-gradient(135deg, #ff90b3, #ffb2d8);
  --strength-weak: #ff7675;
  --strength-medium: #fdcb6e;
  --strength-strong: #55efc4;
}

body {
  font-family: "Poppins", sans-serif;
  /* Gradien soft baru */
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 1rem;
}

.container {
  text-align: center;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
}

.emoji {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 1.5rem;
}

.password-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}

.password-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 40px; 
  height: 25px;
  background: linear-gradient(to bottom, transparent, rgba(238, 241, 255, 0.9));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.password-box.is-scrollable::after {
  opacity: 1;
}

#password {
  flex-grow: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-color);
  letter-spacing: 1px;
  resize: none;
  height: auto;
  max-height: 120px;
  overflow-y: auto;
  word-wrap: break-word;
  line-height: 1.4;
  padding-right: 10px;
}

#password:focus {
  outline: none;
}

#password::-webkit-scrollbar {
  width: 8px;
}

#password::-webkit-scrollbar-track {
  background: transparent;
  margin: 5px 0;
}

#password::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#password::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

#copyBtn {
  position: relative;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
}

#copyBtn:hover {
    background: rgba(0,0,0,0.05);
}

#copyBtn .tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-text);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  white-space: nowrap;
}

#copyBtn.copied .tooltip {
  opacity: 1;
  visibility: visible;
}

.strength-box {
  margin-bottom: 1.5rem;
  text-align: left;
}

#strengthText {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-text);
  font-weight: 600;
}

.strength-bar-container {
    width: 100%;
    height: 8px;
    border-radius: 6px;
    background: rgba(0,0,0,0.07);
}

.strength-bar {
  width: 0%;
  height: 100%;
  border-radius: 6px;
  background: #ddd;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slider-box {
  margin-bottom: 1.5rem;
  text-align: left;
}

.slider-box label {
    font-weight: 600;
    color: var(--secondary-text);
}

.range {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* STYLE BARU UNTUK INPUT ANGKA */
#lengthValue {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-color);
  width: 50px;
  text-align: center;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 0.25rem;
}
#lengthValue:focus {
  outline: 2px solid var(--accent-color);
}
/* Menghilangkan panah di input number */
#lengthValue::-webkit-outer-spin-button,
#lengthValue::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#lengthValue {
  -moz-appearance: textfield;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.07);
  border-radius: 5px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
  text-align: left;
}

.option-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 0.75rem;
    transition: 0.2s;
}
.option-item:hover {
    background: rgba(255, 255, 255, 0.8);
}

.option-item label {
    font-size: 0.9rem;
    color: var(--primary-text);
    cursor: pointer;
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 1.15em;
  height: 1.15em;
  border: 0.15em solid #ccc;
  border-radius: 0.25em;
  transform: translateY(-0.075em);
  display: grid;
  place-content: center;
  margin-right: 0.75em;
  cursor: pointer;
  transition: 0.2s;
}
input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--accent-color);
  transform-origin: bottom left;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="checkbox"]:checked {
    border-color: var(--accent-color);
}
input[type="checkbox"]:checked::before {
  transform: scale(1);
}

#generateBtn {
  background: var(--accent-gradient);
  border: none;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 15px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: 0.3s ease;
  box-shadow: 0 5px 15px rgba(255, 144, 179, 0.4);
}

#generateBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 144, 179, 0.6);
}

#generateBtn:active {
    transform: translateY(0);
}