
/* Basic Reset & Font Setup */
:root {
  --background-color: #121212;
  --surface-color: #1e1e1e;
  --primary-text-color: #e0e0e0;
  --secondary-text-color: #a0a0a0;
  --accent-color: #4CAF50;
  --input-background: #2a2d30;
  --input-border: #444;
  --border-radius: 8px;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--background-color);
  color: var(--primary-text-color);
  line-height: 1.6;
}

/* App Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.app-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.app-header p {
  font-size: 1rem;
  color: var(--secondary-text-color);
  max-width: 80ch;
}

.content-wrapper {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .content-wrapper {
    grid-template-columns: 1fr 1.2fr;
  }
}

/* Form Styling */
.form-section {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--input-border);
}

.form-step {
  margin-bottom: 2rem;
}

.form-step:last-child {
  margin-bottom: 0;
}

.form-step h3 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.25rem;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.form-step p {
  color: var(--secondary-text-color);
  font-size: 0.9rem;
}

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

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input-with-button .form-input {
  flex-grow: 1;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--input-background);
  border: 1px solid var(--input-border);
  border-radius: calc(var(--border-radius) / 2);
  color: var(--primary-text-color);
  font-family: var(--font-body);
  font-size: 1rem;
  box-sizing: border-box;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--secondary-text-color);
  font-size: 0.8rem;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.radio-group {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.radio-group input[type="radio"] {
  margin-right: 0.75rem;
  accent-color: var(--accent-color);
  width: 1em;
  height: 1em;
}

/* AI Button */
.ai-button {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: calc(var(--border-radius) / 2);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: background-color 0.2s, opacity 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.ai-button:hover:not(:disabled) {
  background-color: #45a049;
}

.ai-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Modifier for inline AI button (e.g., for key generation) */
.ai-button.ai-button-inline {
    width: auto;
    flex-shrink: 0;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
}

.ai-button.ai-button-inline .loader {
    width: 16px;
    height: 16px;
    border-width: 2px;
}


.loader {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Code Section Styling */
.code-section {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--input-border);
  display: flex;
  flex-direction: column;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--input-border);
}

.code-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.copy-button {
  background-color: var(--input-background);
  color: var(--primary-text-color);
  border: 1px solid var(--input-border);
  padding: 0.5rem 1rem;
  border-radius: calc(var(--border-radius) / 2);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.copy-button:hover:not(:disabled) {
  background-color: #3c3f41;
}

.copy-button:active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.copy-button:disabled {
    opacity: 0.7;
    cursor: default;
    background-color: var(--input-background);
}


pre {
  margin: 0;
  flex-grow: 1;
  overflow: auto;
  padding: 1.5rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: pre;
  color: var(--primary-text-color);
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}