:root {
  --gradient-bg: #1e1e1e;
  --gradient-btn: linear-gradient(135deg, #3a3f51, #2c2f3a);
  --gradient-btn-hover: linear-gradient(135deg, #4b5168, #343845);
  --error: #ff4e42;
  --reset-dark: #b22222;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gradient-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding: 20px;
  margin: 0;
  color: #f5f5f5;
  overflow-x: hidden;
}

canvas#background-stars {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.container {
  background: linear-gradient(
    145deg,
    rgba(20, 20, 20, 0.7) 0%,
    rgba(30, 30, 30, 0.6) 40%,
    rgba(40, 40, 40, 0.5) 70%,
    rgba(60, 60, 60, 0.4) 100%
  );
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  text-align: center;
  width: 90%;
  max-width: 450px;
  padding: 10px 20px;
}

@media (min-width: 768px) {
  .container {
    padding: 10px 30px;
    max-width: 500px;
  }
}

h1 {
  margin-bottom: 20px;
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.6);
}

.input-group {
  margin-bottom: 15px;
}

label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  font-size: 1rem;
  color: #bbb;
}

#advancedToggleLabel {
    cursor: pointer;
    color: #00c8ff;
}

input[type="text"],
select {
  padding: 14px;
  font-size: 1rem;
  width: 100%;
  border: 1px solid #555;
  border-radius: 12px;
  text-align: center;
  background-color: #444;
  color: #f5f5f5;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #00c8ff;
  box-shadow: 0 0 0 0.3rem rgba(0, 200, 255, 0.3);
}

button {
  padding: 15px 50px;
  background: var(--gradient-btn);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: transform 0.2s ease, background 0.3s ease;
}

button:hover {
  background: var(--gradient-btn-hover);
  transform: scale(1.05);
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
}

.output {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  margin-top: 20px;
  position: relative;
}

.output.show {
  display: block;
  opacity: 1;
}

#totp,
#countdown,
#totpLabel {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#totp.visible,
#countdown.visible,
#totpLabel.visible {
  opacity: 1;
}

#totp {
  font-size: 2.7rem;
  color: #28a745;
  margin-bottom: 10px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  letter-spacing: 0.1em;
}

#countdown {
  font-size: 1.3rem;
  color: #adb5bd;
}

#copyBalloon {
  position: absolute;
  left: 50%;
  top: -25px;
  transform: translateX(-50%);
  background-color: #28a745;
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  z-index: 10;
  user-select: none;
}

.error-msg {
  color: var(--error);
  font-size: 0.95rem;
  margin-top: 6px;
  height: 0;
  opacity: 0;
  transition: all 0.3s ease;
}

.error-msg.show {
  height: auto;
  opacity: 1;
}

#advancedSection {
  display: none;
  margin: 15px 0 20px;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 12px;
}

#advancedSection.show {
  display: block;
}