:root {
  --font-sans: "Inter", sans-serif;
  --text-color: rgb(25, 25, 24);
  --bg-color: #fafafa;
  --border-color: rgba(55, 53, 47, 0.12);
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-32) var(--space-24);
}

/* ========== APP HEADER ========== */
.app-header {
  text-align: center;
  margin-bottom: var(--space-24);
  padding: var(--space-16) var(--space-24);
  margin: calc(-1 * var(--space-32)) calc(-1 * var(--space-24)) var(--space-24);
}

.app-header__title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-color);
  margin: 0;
  padding-bottom: var(--space-16);
}

.app-header__title::after {
  content: "";
  display: block;
  width: 40%;
  height: 1px;
  background: var(--border-color);
  margin: var(--space-16) auto 0;
}

/* Input Section */
.input-section {
  margin-bottom: 32px;
}

.input-card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Input Method Toggle */
.input-method-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: rgba(55, 53, 47, 0.04);
  border-radius: 10px;
}

.method-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(25, 25, 24, 0.6);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.method-btn:hover {
  color: rgb(25, 25, 24);
  background: rgba(55, 53, 47, 0.04);
}

.method-btn.active {
  color: rgb(25, 25, 24);
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.method-btn svg {
  width: 18px;
  height: 18px;
}

/* Text Input */
.input-wrapper {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: rgba(25, 25, 24, 0.6);
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: rgb(25, 25, 24);
  background: rgba(55, 53, 47, 0.04);
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
}

textarea:focus {
  border-color: #2383e2;
  background: white;
}

textarea::placeholder {
  color: rgba(25, 25, 24, 0.4);
}

/* Upload Zone */
.upload-zone {
  border: 1px dashed rgba(55, 53, 47, 0.16);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.upload-zone:hover {
  border-color: #2383e2;
  background: rgba(35, 131, 226, 0.04);
}

.upload-zone.dragover {
  border-color: #2383e2;
  background: rgba(35, 131, 226, 0.08);
}

.upload-icon {
  color: rgba(25, 25, 24, 0.4);
  margin-bottom: 16px;
}

.upload-icon svg {
  width: 48px;
  height: 48px;
}

.upload-text {
  font-size: 16px;
  font-weight: 500;
  color: rgb(25, 25, 24);
  margin-bottom: 4px;
}

.upload-subtext {
  font-size: 14px;
  color: rgba(25, 25, 24, 0.5);
  margin-bottom: 8px;
}

.upload-limit {
  font-size: 13px;
  color: rgba(25, 25, 24, 0.4);
}

/* File Preview */
.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(35, 131, 226, 0.08);
  border: 0.5px solid rgba(35, 131, 226, 0.2);
  border-radius: 8px;
  margin-bottom: 20px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #2383e2;
}

.file-info svg {
  width: 24px;
  height: 24px;
}

.file-info span {
  font-size: 15px;
  font-weight: 500;
}

.remove-file-btn {
  padding: 6px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: rgba(25, 25, 24, 0.5);
  transition: all 0.2s ease;
}

.remove-file-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.remove-file-btn svg {
  width: 18px;
  height: 18px;
}

/* Button Row */
.button-row {
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 50px;
  background: #000000;
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: #1a1a1a;
}

.btn-primary:active:not(:disabled) {
  background: #333333;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.hint {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(25, 25, 24, 0.6);
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 64px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-top: 24px;
}

.spinner-container {
  margin-bottom: 24px;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 3px solid rgba(35, 131, 226, 0.2);
  border-top-color: #2383e2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}

.loading-subtext {
  font-size: 14px;
  color: rgba(25, 25, 24, 0.5);
}

/* Error State */
.error-state {
  text-align: center;
  padding: 32px 24px;
  background: #fef2f2;
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  border-radius: 12px;
  margin-top: 24px;
}

.error-icon {
  color: #dc2626;
  margin-bottom: 12px;
}

.error-icon svg {
  width: 40px;
  height: 40px;
}

.error-text {
  font-size: 16px;
  color: #991b1b;
  margin-bottom: 16px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 500;
  color: #2383e2;
  background: white;
  border: 0.5px solid #2383e2;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: rgba(35, 131, 226, 0.08);
}

/* Result Section */
.result-section {
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  overflow: hidden;
}

.result-card.highlight-card {
  border-left: 4px solid #f59e0b;
}

.result-card.notes-card {
  background: rgba(55, 53, 47, 0.04);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 0.5px solid rgba(55, 53, 47, 0.16);
}

.card-header.collapsible {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
}

.card-header.collapsible:hover {
  background: rgba(55, 53, 47, 0.04);
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: rgb(25, 25, 24);
}

.card-header .chevron {
  width: 20px;
  height: 20px;
  color: rgba(25, 25, 24, 0.4);
  transition: transform 0.2s ease;
}

.card-header.collapsed .chevron {
  transform: rotate(-90deg);
}

.card-body {
  padding: 20px 24px;
}

.card-body.collapsed {
  display: none;
}

/* Summary Card */
.summary-card .card-header {
  background: linear-gradient(135deg, #2383e2 0%, #1b6dc1 100%);
  border: none;
}

.summary-card .card-header h2 {
  color: white;
}

.summary-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-item.full-width {
  grid-column: 1 / -1;
}

.summary-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(25, 25, 24, 0.5);
}

.summary-value {
  font-size: 16px;
  font-weight: 500;
  color: rgb(25, 25, 24);
  line-height: 1.5;
}

/* Clause List */
.clause-item {
  padding: 20px 0;
  border-bottom: 0.5px solid rgba(55, 53, 47, 0.16);
}

.clause-item:last-child {
  border-bottom: none;
}

.clause-title {
  font-size: 16px;
  font-weight: 600;
  color: rgb(25, 25, 24);
  margin-bottom: 8px;
}

.clause-original {
  font-size: 14px;
  color: rgba(25, 25, 24, 0.6);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(55, 53, 47, 0.16);
}

.clause-explanation {
  font-size: 15px;
  line-height: 1.6;
  color: rgb(25, 25, 24);
}

/* Obligations Grid */
.obligations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.obligations-column h3 {
  font-size: 15px;
  font-weight: 600;
  color: rgb(25, 25, 24);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid rgba(55, 53, 47, 0.16);
}

.your-obligations h3 {
  border-color: #2383e2;
}

.other-obligations h3 {
  border-color: #8b5cf6;
}

.obligations-column ul {
  list-style: none;
}

.obligations-column li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: rgb(25, 25, 24);
}

.obligations-column li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.your-obligations li::before {
  background: #2383e2;
}

.other-obligations li::before {
  background: #8b5cf6;
}

/* Commitments */
.commitment-item {
  padding: 16px 0;
  border-bottom: 0.5px solid rgba(55, 53, 47, 0.16);
}

.commitment-item:last-child {
  border-bottom: none;
}

.commitment-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.commitment-type.commitment {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.commitment-type.restriction {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.commitment-type.exclusivity {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.commitment-type.confidentiality {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.commitment-type.limitation {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.commitment-description {
  font-size: 15px;
  font-weight: 500;
  color: rgb(25, 25, 24);
  margin-bottom: 6px;
}

.commitment-impact {
  font-size: 14px;
  color: rgba(25, 25, 24, 0.7);
  line-height: 1.5;
}

/* Risks */
.risk-item {
  padding: 16px;
  background: rgba(239, 68, 68, 0.04);
  border-radius: 8px;
  margin-bottom: 12px;
}

.risk-item:last-child {
  margin-bottom: 0;
}

.risk-scenario {
  font-size: 15px;
  font-weight: 500;
  color: rgb(25, 25, 24);
  margin-bottom: 8px;
}

.risk-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.risk-trigger,
.risk-consequence {
  font-size: 14px;
  color: rgba(25, 25, 24, 0.8);
}

.risk-trigger strong,
.risk-consequence strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(25, 25, 24, 0.5);
  margin-bottom: 4px;
}

/* Duration Grid */
.duration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.duration-item {
  padding: 16px;
  background: rgba(55, 53, 47, 0.04);
  border-radius: 8px;
}

.duration-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(25, 25, 24, 0.5);
  margin-bottom: 8px;
}

.duration-value {
  font-size: 15px;
  color: rgb(25, 25, 24);
  line-height: 1.5;
}

/* Commonly Missed */
.missed-item {
  padding: 16px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 8px;
  margin-bottom: 12px;
}

.missed-item:last-child {
  margin-bottom: 0;
}

.missed-item.one-sided {
  border-left: 3px solid #f59e0b;
}

.missed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.missed-clause {
  font-size: 13px;
  font-weight: 500;
  color: rgba(25, 25, 24, 0.6);
}

.one-sided-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-radius: 3px;
}

.missed-what {
  font-size: 15px;
  font-weight: 500;
  color: rgb(25, 25, 24);
  margin-bottom: 6px;
}

.missed-why {
  font-size: 14px;
  color: rgba(25, 25, 24, 0.7);
  line-height: 1.5;
}

/* Notes Card */
.notes-card .card-body p {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(25, 25, 24, 0.8);
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(25, 25, 24, 0.8);
  background: white;
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.btn-secondary:hover {
  background: rgba(55, 53, 47, 0.08);
  border-color: rgba(55, 53, 47, 0.24);
}

.btn-secondary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary.primary {
  background: #2383e2;
  border-color: #2383e2;
  color: white;
}

.btn-secondary.primary:hover {
  background: #1b6dc1;
  border-color: #1b6dc1;
}

/* Disclaimer */
.disclaimer {
  margin-top: 48px;
  padding: 20px;
  background: rgba(55, 53, 47, 0.04);
  border-radius: 8px;
  text-align: center;
}

.disclaimer p {
  font-size: 13px;
  color: rgba(25, 25, 24, 0.6);
  line-height: 1.5;
}

.disclaimer strong {
  color: rgba(25, 25, 24, 0.8);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .container {
    padding: var(--space-24) var(--space-16);
  }

  .app-header {
    padding: var(--space-12) var(--space-16);
    margin: calc(-1 * var(--space-24)) calc(-1 * var(--space-16)) var(--space-20);
  }

  .app-header__title {
    font-size: 28px;
  }

  .input-card {
    padding: 24px;
  }

  .input-method-toggle {
    flex-direction: column;
  }

  textarea {
    min-height: 200px;
    font-size: 16px;
  }

  .summary-content {
    grid-template-columns: 1fr;
  }

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

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

  .risk-details {
    grid-template-columns: 1fr;
  }

  .result-actions {
    flex-direction: column;
  }

  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 32px;
  }

  .card-header {
    padding: 16px 20px;
  }

  .card-body {
    padding: 16px 20px;
  }
}