@import "../shared.css";

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

:root {
  --bg: var(--page-bg);
  --text: var(--pesu-blue);
  --text-secondary: #5a6b8a;
  --accent: var(--pesu-orange);
  --accent-hover: #e05e00;
  --optional: #8a9bb5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.container {
  width: 100%;
  max-width: 640px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

fieldset {
  border: none;
  margin-bottom: 1.5rem;
}

legend {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

input, select, textarea {
  width: 100%;
  font-family: inherit;
  background-color: var(--surface);
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.optional {
  color: var(--optional);
  font-weight: 400;
  font-size: 0.75rem;
}

button {
  width: 100%;
  padding: 0.625rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.15s;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: pre-wrap;
}

#result.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

#result.error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
}

.code-preview {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #f0f4f8;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text);
}

.code-preview.hidden {
  display: none;
}

.code-preview strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 4px;
  background: var(--pesu-blue);
  color: white;
}

.badge.lateral {
  background: var(--pesu-orange);
}

.hidden {
  display: none;
}

.form-link {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.form-link:hover {
  color: var(--accent);
}
