* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  margin-top: 0.5rem;
  color: #a0aec0;
  font-size: 0.95rem;
}

main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Drop Zones */
.drop-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.drop-zone {
  background: white;
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop-zone:hover {
  border-color: #2b6cb0;
  background: #ebf8ff;
}

.drop-zone.drag-over {
  border-color: #2b6cb0;
  background: #bee3f8;
  transform: scale(1.02);
}

.drop-zone.processing {
  border-color: #d69e2e;
  background: #fefcbf;
  pointer-events: none;
}

.drop-zone-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.drop-zone-icon {
  color: #a0aec0;
  margin-bottom: 1rem;
}

.drop-zone:hover .drop-zone-icon {
  color: #2b6cb0;
}

.drop-zone h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #2d3748;
}

.drop-zone p {
  font-size: 0.9rem;
  color: #718096;
}

.file-name {
  font-weight: 600;
  color: #2b6cb0 !important;
  margin-top: 0.5rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #2b6cb0;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  color: #718096;
  font-size: 0.95rem;
}

/* Results */
.results {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-section {
  background: white;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}

.result-header h3 {
  font-size: 1rem;
  color: #2d3748;
}

.result-content {
  padding: 1.5rem;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #4a5568;
  font-family: 'Segoe UI', sans-serif;
}

.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Buttons */
.copy-btn {
  background: #2b6cb0;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #2c5282;
}

.copy-btn.copied {
  background: #38a169;
}

.copy-all {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

.reset-btn {
  background: #e2e8f0;
  color: #4a5568;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.reset-btn:hover {
  background: #cbd5e0;
}

/* Error */
.error {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.error p {
  color: #c53030;
  margin-bottom: 1rem;
}

/* Renewal staged files */
.staged-files {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  text-align: left;
  width: 100%;
}

.staged-files li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  margin: 4px 0;
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #2b6cb0;
}

.staged-files li .remove-file {
  background: none;
  border: none;
  color: #c53030;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  line-height: 1;
}

.staged-files li .remove-file:hover {
  color: #9b2c2c;
}

.renewal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.process-btn {
  background: #2b6cb0;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.process-btn:hover {
  background: #2c5282;
}

.clear-btn {
  background: #e2e8f0;
  color: #4a5568;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.clear-btn:hover {
  background: #cbd5e0;
}

/* Quote Template Table */
.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.5;
}

.quote-table tr {
  border-bottom: 1px solid #e2e8f0;
}

.quote-table tr:last-child {
  border-bottom: none;
}

.quote-table td {
  padding: 10px 14px;
  vertical-align: top;
}

.qt-label {
  width: 200px;
  min-width: 180px;
  font-weight: 600;
  color: #2d3748;
  background: #f7fafc;
  white-space: nowrap;
}

.qt-value {
  color: #4a5568;
}

.qt-pre {
  white-space: pre-wrap;
}

.qt-list {
  margin: 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  list-style: disc;
}

.qt-list li {
  padding: 2px 0;
  font-size: 0.85rem;
}

.qt-section-header td {
  background: #1a1a2e;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 14px;
}

/* Utility */
.hidden {
  display: none !important;
}

footer {
  text-align: center;
  padding: 1.5rem;
  color: #a0aec0;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .drop-zones {
    grid-template-columns: 1fr;
  }
  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
