/* T&C Summariser Styles */

:root {
  --font-sans: "Inter", sans-serif;
  --text-color: rgb(25, 25, 24);
  --bg-color: #fafafa;
  --border-color: rgba(55, 53, 47, 0.12);
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --primary-color: #2383e2;
  --primary-hover: #1b6dc1;
  --primary-active: #155a9e;
  --text-muted: rgba(25, 25, 24, 0.9);
  --text-secondary: rgba(25, 23, 17, 0.6);
  --hover-surface: rgba(55, 53, 47, 0.08);
  --selection-bg: rgba(35, 131, 226, 0.28);
  --error-color: #eb5757;
  --success-color: #27ae60;
  --warning-color: #f2994a;
}

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

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;
}

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

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

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

h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

h3 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin-bottom: 12px;
}

p {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Input Section */
.input-card {
  background: white;
  border: 0.5px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  padding: 16px;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  border: 0.5px solid var(--border-color);
  border-radius: 8px;
  resize: vertical;
  background: #f9f9f9;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px var(--selection-bg);
}

.button-row {
  display: flex;
  justify-content: center;
}

.btn-primary {
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 50px;
  background: #000000;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
  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: 20px;
  height: 20px;
}

.btn-secondary {
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  background: white;
  color: var(--text-color);
  border: 0.5px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

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

.hint {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 16px;
  margin-bottom: 0;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 48px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--selection-bg);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-text {
  font-weight: 600;
  margin-bottom: 4px;
}

.loading-subtext {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Error State */
.error-state {
  background: #fff5f5;
  border: 0.5px solid #feb2b2;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-top: 24px;
}

.error-icon {
  color: var(--error-color);
  margin-bottom: 12px;
}

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

.error-text {
  color: #c53030;
  font-weight: 500;
  margin-bottom: 16px;
}

.btn-outline {
  padding: 8px 16px;
  border-radius: 6px;
  border: 0.5px solid #c53030;
  background: transparent;
  color: #c53030;
  cursor: pointer;
}

/* Results Section */
.result-section {
  animation: fadeIn 0.4s ease-out;
}

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

.result-card {
  background: white;
  border: 0.5px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.card-header h2 {
  margin-bottom: 24px;
  border-bottom: 0.5px solid var(--border-color);
  padding-bottom: 12px;
}

.overview-text {
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.structural-favor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f3f5;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 15px;
}

.structural-favor .label {
  font-weight: 600;
  color: var(--text-secondary);
}

.structural-favor .value {
  font-weight: 700;
  color: var(--primary-color);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}

.item-list {
  list-style: none;
}

.item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border-color);
}

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

.item-title {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 4px;
  display: block;
}

.item-desc {
  font-size: 16px;
  color: var(--text-muted);
}

.item-meta {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
}

/* Power, Right, Risk styles */
.tag-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
}

.severity-high { background: #fee2e2; color: #991b1b; }
.severity-medium { background: #fef3c7; color: #92400e; }
.severity-low { background: #ecfdf5; color: #065f46; }

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

.duration-item {
  display: flex;
  flex-direction: column;
}

.duration-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.duration-value {
  font-size: 17px;
  font-weight: 500;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.check-icon {
  color: var(--success-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.checklist-text {
  font-size: 16px;
  font-weight: 500;
}

.standard-tag {
  font-size: 11px;
  padding: 2px 6px;
  background: #e2e8f0;
  color: #475569;
  border-radius: 4px;
  margin-left: 8px;
}

.result-actions {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.disclaimer {
  margin-top: 80px;
  padding: 24px;
  background: #f9f9f9;
  border-radius: 8px;
  border-left: 0.5px solid var(--border-color);
}

.disclaimer p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

