*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f4f0;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 4rem;
}

header {
  width: 100%;
  max-width: 680px;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.logo {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 0.5rem;
}

main {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  border: 1px solid #e5e5e5;
}

.card h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group:last-of-type {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #333;
}

label .required {
  color: #c0392b;
  margin-left: 2px;
}

label .optional {
  color: #999;
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 4px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.15s;
  appearance: none;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #2c6e49;
  box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background: #2c6e49;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.25rem;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button[type="submit"]:hover {
  background: #235c3b;
}

button[type="submit"]:disabled {
  background: #a0b8ab;
  cursor: not-allowed;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

button[type="submit"].loading .spinner {
  display: block;
}

button[type="submit"].loading .btn-text {
  opacity: 0.8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.output-card {
  display: none;
}

.output-card.visible {
  display: block;
}

.output-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.output-label h2 {
  margin-bottom: 0;
}

.zone-badge {
  font-size: 0.75rem;
  font-weight: 500;
  background: #eaf3ec;
  color: #2c6e49;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

#html-output {
  width: 100%;
  min-height: 100px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  background: #f8f8f6;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.75rem;
  color: #333;
  resize: vertical;
}

.copy-btn {
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: #333;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.copy-btn:hover {
  border-color: #2c6e49;
  color: #2c6e49;
}

.copy-btn.copied {
  background: #eaf3ec;
  border-color: #2c6e49;
  color: #2c6e49;
}

.error-msg {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fdf0ef;
  border-radius: 6px;
  border: 1px solid #f5c6c3;
  display: none;
}

.error-msg.visible {
  display: block;
}

.hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 0.3rem;
}
