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

:root {
  --primary: #1E3A5F;
  --primary-light: #2a4d7a;
  --secondary: #E67E22;
  --secondary-light: #f39c4b;
  --success: #27ae60;
  --danger: #e74c3c;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f0 100%);
  min-height: 100vh;
  color: var(--gray-800);
  line-height: 1.6;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.logo-img {
  height: 32px;
  width: auto;
}

.logo-divider {
  color: var(--gray-400);
  font-weight: 300;
  margin: 0 0.25rem;
}

.logo-text {
  color: var(--gray-700);
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--gray-100);
}

/* Main */
.main {
  flex: 1;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Steps */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-300);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.3s;
}

.step.active .step-number,
.step.completed .step-number {
  background: var(--primary);
  color: var(--white);
}

.step.completed .step-number {
  background: var(--success);
}

.step-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
}

.step.active .step-label {
  color: var(--primary);
}

.step-line {
  height: 2px;
  width: 60px;
  background: var(--gray-300);
  margin: 0 1rem;
}

/* Card */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}

.card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--gray-600);
  margin-bottom: 2rem;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.required {
  color: var(--danger);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.help-text {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

.input-with-button {
  display: flex;
  gap: 0.75rem;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-primary:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background: #219a52;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.form-actions .btn:only-child {
  margin-left: auto;
}

/* Step Content */
.step-content {
  display: none;
}

.step-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrape Result */
.scrape-result {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-section {
  margin-bottom: 1.5rem;
}

.result-section:last-child {
  margin-bottom: 0;
}

.result-section h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.logo-preview {
  width: 120px;
  height: 80px;
  background: var(--white);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-preview .placeholder {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.upload-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.upload-link {
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
}

.colors-preview {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.color-swatch {
  width: 80px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.25rem;
  box-shadow: var(--shadow);
}

.color-swatch span {
  font-size: 0.75rem;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.color-inputs {
  display: flex;
  gap: 1rem;
}

.color-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-input-group label {
  font-size: 0.875rem;
  color: var(--gray-600);
}

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

/* Preview */
.preview-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.preview-cover {
  aspect-ratio: 148/210;
  background: var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.preview-cover::before,
.preview-cover::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  background: var(--secondary);
  opacity: 0.8;
  border-radius: 50% 0;
}

.preview-cover::before {
  top: 10px;
  left: 10px;
  transform: rotate(45deg);
}

.preview-cover::after {
  bottom: 10px;
  right: 10px;
  transform: rotate(-135deg);
}

.preview-logo {
  width: 60px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.preview-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}

.preview-tagline {
  font-size: 0.625rem;
  font-style: italic;
  color: var(--secondary);
  margin-bottom: auto;
}

.preview-coach {
  font-size: 0.625rem;
  margin-top: auto;
}

.preview-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.preview-label {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.preview-value {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: var(--shadow);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: modalIn 0.3s ease;
}

.modal-large {
  max-width: 700px;
  text-align: left;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.modal-content h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.modal-content p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-500);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--gray-700);
}

/* Journals List */
.journals-list {
  max-height: 400px;
  overflow-y: auto;
}

.journal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.journal-info h4 {
  font-size: 1rem;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}

.journal-info p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 0;
}

.journal-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  padding: 0.5rem;
  font-size: 1rem;
}

.empty-state {
  text-align: center;
  color: var(--gray-500);
  padding: 2rem;
}

/* Footer */
.footer {
  background: var(--white);
  padding: 1rem 2rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
  border-top: 1px solid var(--gray-200);
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }

  .main {
    padding: 1rem;
  }

  .steps {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .step-line {
    display: none;
  }

  .step {
    flex-direction: row;
    gap: 0.5rem;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .card {
    padding: 1.5rem;
  }

  .preview-card {
    grid-template-columns: 1fr;
  }

  .preview-cover {
    max-width: 200px;
    margin: 0 auto;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions .btn {
    width: 100%;
  }

  .input-with-button {
    flex-direction: column;
  }
}
