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

:root {
  --sorum-primary: #0066CC;
  --sorum-primary-dark: #0052A3;
  --sorum-secondary: #00D4AA;
  --sorum-dark: #1a1a2e;
  --sorum-gray: #f8f9fa;
  --text: #2c3e50;
  --text-light: #6c757d;
  --border: #dee2e6;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--sorum-gray);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* SORUM Logo */
.sorum-logo {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--sorum-primary) 0%, var(--sorum-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  text-align: center;
}

.sorum-logo-small {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--sorum-primary) 0%, var(--sorum-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Steps - WICHTIG für nacheinander anzeigen */
.step {
  display: none;
  min-height: 100vh;
}

.step.active {
  display: flex;
  flex-direction: column;
}

.step-content {
  max-width: 600px;
  margin: 60px auto;
}

/* Code Entry – nur anzeigen wenn .active (Step 1) */
#code-entry.step.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#code-entry .logo-area {
  text-align: center;
  margin-bottom: 40px;
}

#code-entry h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--sorum-dark);
  font-weight: 700;
}

#code-entry .subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
}

.input-card {
  background: white;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.input-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.95rem;
}

.input-card input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
  font-family: monospace;
}

.input-card input[type="text"]:focus {
  outline: none;
  border-color: var(--sorum-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.hint {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

.hint code {
  background: var(--sorum-gray);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-text {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.btn-primary {
  background: var(--sorum-primary);
  color: white;
  width: 100%;
  margin-top: 20px;
}

.btn-primary:hover {
  background: var(--sorum-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--sorum-primary);
  color: var(--sorum-primary);
}

.btn-text {
  background: transparent;
  color: var(--text-light);
  padding: 8px 16px;
}

.btn-text:hover {
  color: var(--sorum-primary);
  background: rgba(0, 102, 204, 0.05);
}

/* Configurator – Header und Karte gemeinsam 70% Breite */
#configurator {
  padding-top: 20px;
  width: 70%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.config-header {
  background: white;
  padding: 20px 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.config-header h2 {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sorum-dark);
}

.config-layout {
  display: block;
  width: 100%;
}

.editor-panel {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.config-sections {
  padding: 30px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.config-group {
  margin-bottom: 35px;
  padding-bottom: 35px;
  border-bottom: 1px solid var(--border);
}

.config-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.config-group h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--sorum-dark);
  font-weight: 700;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-field small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.form-field input[type="text"],
.form-field input[type="url"],
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  font-family: inherit;
  resize: vertical;
}

.form-field input[type="text"]:focus,
.form-field input[type="url"]:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--sorum-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Range with Input */
.range-with-input {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-with-input input[type="range"] {
  flex: 1;
  height: 6px;
  background: var(--sorum-gray);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.range-with-input input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--sorum-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.range-with-input input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: var(--sorum-primary-dark);
}

.range-with-input input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--sorum-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-with-input input[type="number"] {
  width: 80px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
  color: var(--sorum-primary);
}

.range-with-input input[type="number"]:focus {
  outline: none;
  border-color: var(--sorum-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Color Inputs */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.color-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  transition: border-color 0.2s;
}

.color-input:hover {
  border-color: var(--sorum-primary);
}

.color-input input[type="color"] {
  width: 50px;
  height: 40px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.color-input span {
  font-family: monospace;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

/* Logo Upload */
.logo-upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-preview-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--sorum-gray);
  position: relative;
  flex-shrink: 0;
}

#logo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

#logo-preview.active {
  display: block;
}

#logo-placeholder {
  font-size: 2rem;
  opacity: 0.3;
}

#logo-placeholder.hidden {
  display: none;
}

.upload-controls {
  flex: 1;
}

/* Action Buttons */
.action-buttons {
  padding: 20px 30px;
  border-top: 1px solid var(--border);
  background: white;
}

/* Snippet Display – nur anzeigen wenn .active (nach Speichern) */
#snippet-display.step.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#snippet-display .success-icon {
  font-size: 4rem;
  text-align: center;
  margin: 20px 0;
}

#snippet-display h1 {
  text-align: center;
  color: var(--sorum-dark);
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 700;
}

#snippet-display .subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.snippet-card {
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
}

.snippet-card h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: var(--sorum-dark);
}

#snippet-code {
  background: var(--sorum-dark);
  color: #abb2bf;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  margin: 15px 0;
  white-space: pre;
  border: 1px solid rgba(255,255,255,0.1);
}

.footer-note {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-note p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.footer-note a {
  color: var(--sorum-primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-note a:hover {
  text-decoration: underline;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--sorum-dark);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
  font-weight: 500;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--error);
}

/* Scrollbar Styling */
.config-sections::-webkit-scrollbar {
  width: 8px;
}

.config-sections::-webkit-scrollbar-track {
  background: var(--sorum-gray);
}

.config-sections::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.config-sections::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  #configurator {
    width: 100%;
  }

  .input-card {
    padding: 30px 20px;
  }

  .config-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .color-grid {
    grid-template-columns: 1fr;
  }

  .sorum-logo {
    font-size: 2rem;
  }

  #code-entry h1 {
    font-size: 1.5rem;
  }

  #snippet-display h1 {
    font-size: 1.5rem;
  }
}