/* Tokens/base come from /design-system/directly.css */

* {
  margin: 0;
  padding: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.header .dx-logo {
  justify-content: center;
  margin-bottom: 18px;
}

.header h1 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg);
  padding: 4px;
  border-radius: 8px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--card);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: #eaf8f8;
}

.drop-zone-content svg {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.drop-zone .link {
  color: var(--accent);
  text-decoration: underline;
}

.drop-zone .hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.file-name {
  margin-top: 12px;
  font-weight: 500;
  color: var(--primary);
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

input[type="url"],
input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #08aeb933;
}

.meta-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 600px) {
  .meta-fields {
    grid-template-columns: 1fr;
  }
}

.btn-primary {
  width: 100%;
  margin-top: 24px;
  padding: 14px 24px;
  background: var(--dx-grad-cta);
  color: white;
  border: none;
  border-radius: var(--dx-radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--dx-shadow-cta);
  transition: opacity var(--dx-ease);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.94;
}

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

.btn-secondary {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-outline {
  padding: 8px 16px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--bg);
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.result-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.result-header h2 {
  font-size: 1.25rem;
  color: var(--primary);
}

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warning-banner {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.report-content {
  font-size: 0.95rem;
}

.report-content h1 {
  font-size: 1.5rem;
  color: var(--primary);
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.report-content h1:first-child {
  margin-top: 0;
}

.report-content h2 {
  font-size: 1.2rem;
  color: var(--primary-hover);
  margin: 20px 0 12px;
}

.report-content h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin: 16px 0 8px;
}

.report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.875rem;
  overflow-x: auto;
  display: block;
}

.report-content th,
.report-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.report-content th {
  background: #edf2f7;
  font-weight: 600;
}

.report-content tr:nth-child(even) {
  background: #f7fafc;
}

.report-content ul,
.report-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.report-content p {
  margin: 8px 0;
}

.report-content strong {
  color: var(--primary);
}

.error-card {
  border-left: 4px solid var(--error);
}

.error-card h2 {
  color: var(--error);
  margin-bottom: 8px;
}

.error-card p {
  margin-bottom: 16px;
  color: var(--text);
}

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 32px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.history-header h2 {
  font-size: 1.15rem;
  color: var(--primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.history-item:hover,
.history-item.active {
  border-color: var(--accent);
  background: #ebf8ff;
}

.history-item-main {
  min-width: 0;
}

.history-company {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.history-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.history-open {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.dx-auth-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.dx-auth-status {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dx-auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(19, 36, 59, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dx-auth-modal {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.dx-auth-modal h3 {
  margin-bottom: 8px;
  color: var(--primary);
}

.dx-auth-modal > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.dx-auth-modal label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.dx-auth-modal input {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d7e2ea);
  border-radius: 8px;
}

.dx-auth-modal-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.dx-auth-error {
  color: #b42318;
  font-size: 0.85rem;
  margin: 8px 0;
}
