*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  padding: 40px 48px;
  max-width: 680px;
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0 0 32px;
}

/* Controls row */
.controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

select {
  appearance: none;
  background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 36px 10px 14px;
  font-size: 0.95rem;
  color: #1f2937;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 220px;
}

select:focus {
  outline: none;
  border-color: #0078ff;
}

/* Generate button */
#generateBtn {
  background: #0078ff;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

#generateBtn:hover {
  background: #005fcc;
}

#generateBtn:active {
  transform: scale(0.97);
}

#generateBtn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  transform: none;
}

/* Result box */
.result-box {
  background: #f8faff;
  border: 1.5px solid #dbeafe;
  border-radius: 12px;
  padding: 24px 28px;
  position: relative;
  text-align: left;
  animation: fadeIn 0.3s ease;
}

.result-box.hidden {
  display: none;
}

#result {
  font-size: 1.2rem;
  color: #1e3a5f;
  line-height: 1.6;
  margin: 0 0 16px;
  font-weight: 500;
}

/* Copy button */
.copy-btn {
  background: transparent;
  border: 1.5px solid #93c5fd;
  color: #0078ff;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: #0078ff;
  color: #fff;
}

/* Error */
.error {
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 8px;
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .card {
    padding: 28px 20px;
  }
  select {
    min-width: 100%;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  #generateBtn {
    width: 100%;
  }
}
