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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f8fafc;
  color: #0f172b;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 24px 0;
}

.logo {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

header h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 36px;
  color: #0f172b;
  letter-spacing: -0.75px;
  margin-bottom: 8px;
}

.subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #45556c;
  letter-spacing: -0.31px;
}

/* Card */
.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.card h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: #0f172b;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: -0.4px;
}

/* Form Group */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 8px;
  color: #0f172b;
  letter-spacing: -0.15px;
}

.section-description {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #45556c;
  margin-bottom: 20px;
  letter-spacing: -0.15px;
}

/* File Upload */
.file-upload {
  position: relative;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  border: 2px dashed #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.file-upload-content {
  color: #64748b;
}

.file-upload-content .upload-text,
.file-upload-content .file-name {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.15px;
}

.file-upload-content .file-name {
  color: #0f172b;
  word-break: break-all;
  text-align: center;
}

.file-upload:hover .file-upload-content {
  border-color: #155dfc;
  background: #eff6ff;
  color: #155dfc;
}

/* File selected state */
.file-upload.has-file .file-upload-content {
  border-color: #10b981;
  background: #ecfdf5;
  border-style: solid;
  color: #065f46;
}

.file-upload.has-file .file-upload-content .upload-icon {
  display: none;
}

.file-upload.has-file .file-upload-content .check-icon {
  display: block !important;
}

.file-upload.has-file .file-upload-content .upload-text {
  display: none;
}

.file-upload.has-file .file-upload-content .file-name {
  display: block !important;
  color: #065f46;
}

.file-upload.has-file:hover .file-upload-content {
  border-color: #059669;
  background: #d1fae5;
}

.form-group small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #64748b;
  margin-top: 8px;
  letter-spacing: -0.1px;
}

.form-group textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #0f172b;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.form-group textarea::placeholder {
  color: #94a3b8;
}

.form-group textarea:focus {
  outline: none;
  border-color: #155dfc;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.15px;
}

.btn-primary {
  background: #155dfc;
  color: white;
  width: 100%;
  height: 48px;
}

.btn-primary:hover:not(:disabled) {
  background: #1248cc;
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ffffff;
  color: #314158;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.hidden {
  display: none !important;
}

/* Data Grid */
.data-grid {
  display: grid;
  gap: 16px;
}

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

.data-item .label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-item code {
  background: #f1f5f9;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 18px;
  word-break: break-all;
  color: #0f172b;
  border: 1px solid #e2e8f0;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 28px 1fr 28px 1fr;
  gap: 0;
  margin-bottom: 24px;
  align-items: stretch;
}

/* Chain Connector */
.chain-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chain-connector .chain-line {
  width: 100%;
  height: 2px;
  background: #cbd5e1;
}

/* Broken chain state */
.chain-connector.broken .chain-line {
  background: #ef4444;
}

.chain-connector.broken::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  color: #ef4444;
  background: #ffffff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ef4444;
  line-height: 1;
}

@media (max-width: 700px) {
  .results-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .chain-connector {
    height: 28px;
    width: 100%;
  }

  .chain-connector .chain-line {
    width: 2px;
    height: 100%;
  }
}

.result-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-icon {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.result-card h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #45556c;
  margin-bottom: 12px;
  letter-spacing: -0.15px;
}

.result-card .status {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  padding: 8px 16px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: inline-block;
}

.result-card .status.pending {
  background: #fef3c7;
  color: #92400e;
}

.result-card .status.valid {
  background: #d1fae5;
  color: #065f46;
}

.result-card .status.invalid {
  background: #fee2e2;
  color: #991b1b;
}

.result-card .status.loading {
  background: #dbeafe;
  color: #1e40af;
}

.result-card .details {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 16px;
  color: #64748b;
  margin-top: 8px;
}


/* TSA Warning (eIDAS) */
.tsa-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 10px;
  color: #92400e;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.1px;
  margin-bottom: 20px;
}

.tsa-warning svg {
  flex-shrink: 0;
  color: #d97706;
}

.tsa-warning span {
  flex: 1;
}

/* Validation Details (Proof & TSA info) */
.validation-details {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.details-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.details-column h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: #0f172b;
  margin-bottom: 16px;
  letter-spacing: -0.15px;
}

.detail-item {
  margin-bottom: 12px;
}

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

.detail-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 11px;
  line-height: 14px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-item code {
  display: block;
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  line-height: 16px;
  word-break: break-all;
  color: #0f172b;
  border: 1px solid #e2e8f0;
}

/* Technical Footer (inside validation results) */
.technical-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.technical-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #64748b;
  transition: color 0.2s ease;
}

.technical-header:hover {
  color: #155dfc;
}

.expand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #f1f5f9;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.expand-icon svg {
  transition: transform 0.2s ease;
}

.expand-icon.expanded svg {
  transform: rotate(180deg);
}

.technical-header:hover .expand-icon {
  background: #eff6ff;
  color: #155dfc;
}

.technical-content {
  padding-top: 16px;
}

.technical-content .tech-section {
  margin-bottom: 20px;
}

.technical-content .tech-section:last-child {
  margin-bottom: 0;
}

.technical-content .tech-section h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  color: #64748b;
  margin-bottom: 8px;
  letter-spacing: -0.1px;
}

.technical-content .tech-section pre {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: #334155;
  border: 1px solid #e2e8f0;
  max-height: 200px;
  overflow-y: auto;
}

/* Data Hash Info */
.data-hash-info {
  background: #eff6ff;
  padding: 16px;
  border-radius: 10px;
  margin-top: 20px;
  border: 1px solid #bfdbfe;
}

.data-hash-info .label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.algorithm-badge {
  display: inline-block;
  background: #1e40af;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-hash-info code {
  display: block;
  margin-top: 8px;
  background: white;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 18px;
  word-break: break-all;
  color: #0f172b;
  border: 1px solid #bfdbfe;
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #0f172b;
  letter-spacing: -0.15px;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #155dfc;
  cursor: pointer;
}

/* Result Box */
.result-box {
  margin-top: 20px;
  padding: 16px;
  border-radius: 10px;
}

.result-box.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.result-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.result-box code {
  display: block;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 18px;
  word-break: break-all;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 0;
  margin-top: 16px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

footer p {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 18px;
  color: #64748b;
  letter-spacing: -0.1px;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid #155dfc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

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

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 20px 16px;
  }

  header h1 {
    font-size: 24px;
    line-height: 32px;
  }

  .card {
    padding: 24px 20px;
  }

  .card h2 {
    font-size: 16px;
  }

  .file-upload-content {
    padding: 20px;
  }

  .radio-group {
    gap: 16px;
  }
}
