/* ── Reset & base ────────────────────────────────────────────────────────── */

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

:root {
  /* ── Paleta Legitfy (extraída da logomarca) ───────────────── */
  --bg:           #000000;          /* fundo preto puro — igual ao logo    */
  --surface:      #0b0f18;          /* superfície principal                */
  --surface2:     #101624;          /* superfície elevada                  */
  --surface3:     #161d2e;          /* cartões, inputs                     */
  --border:       #1e3a5f;          /* borda azul-escuro do cubo           */
  --border-light: #254d7a;

  /* Azuis do logo (texto "Legitfy" + cubo) */
  --blue-dark:    #0d47a1;          /* azul mais escuro                    */
  --blue-mid:     #1565c0;          /* azul do texto da marca              */
  --blue:         #1976d2;          /* azul principal                      */
  --blue-light:   #42a5f5;          /* azul claro do cubo                  */
  --blue-cyan:    #4fc3f7;          /* ciano do destaque do cubo           */

  /* Cinzas metálicos do cubo */
  --metal-dark:   #37474f;
  --metal-mid:    #546e7a;
  --metal-light:  #78909c;
  --metal-pale:   #90a4ae;
  --metal-white:  #b0bec5;

  /* Texto */
  --text:         #e3f2fd;          /* branco-azulado suave                */
  --text-dim:     #b0bec5;          /* texto secundário                    */
  --muted:        #78909c;          /* texto suave                         */

  /* Status */
  --success:      #1b5e20;
  --success-text: #69f0ae;
  --danger:       #b71c1c;
  --danger-text:  #ff8a80;
  --warn:         #e65100;
  --warn-text:    #ffcc02;
  --info-text:    var(--blue-cyan);

  --radius:  12px;
  --radius-sm: 8px;
  --shadow:  0 4px 32px rgba(0, 0, 0, 0.7);
  --glow:    0 0 24px rgba(25, 118, 210, 0.25);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

header {
  text-align: center;
  padding: 2.8rem 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #050a14 0%, #000000 100%);
  position: relative;
  overflow: hidden;
}

/* Brilho sutil no topo, como reflexo do cubo */
header::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, rgba(25,118,210,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.header-logo img {
  height: 120px;
  width: auto;
  filter: drop-shadow(0 0 18px rgba(66, 165, 245, 0.35));
}

@media (max-width: 600px) {
  .header-logo img { height: 88px; }
}

/* Fallback quando a imagem não existe: exibe o nome com gradiente */
.logo-text-fallback {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-cyan) 50%, var(--metal-white) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

.badge-blockchain {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.25rem 0.8rem;
  background: rgba(25, 118, 210, 0.15);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.72rem;
  color: var(--blue-light);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* ── Main ────────────────────────────────────────────────────────────────── */

main {
  flex: 1;
  max-width: 780px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */

.tab-bar {
  display: flex;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  margin-bottom: 1.8rem;
}

.tab {
  flex: 1;
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

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

.tab.active {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  color: #fff;
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.4);
}

/* ── Tab content ─────────────────────────────────────────────────────────── */

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.section-desc {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

/* ── Drop zone ───────────────────────────────────────────────────────────── */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  cursor: pointer;
  margin-bottom: 1rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue-light);
  background: var(--surface2);
  box-shadow: var(--glow);
}

.drop-icon { font-size: 3rem; margin-bottom: 0.8rem; }
.drop-zone p { color: var(--muted); margin-bottom: 0.4rem; font-size: 0.9rem; }
.drop-zone .sub { font-size: 0.82rem; }
.accepted { font-size: 0.76rem; color: var(--metal-mid); margin-top: 0.8rem; }

/* ── File info ───────────────────────────────────────────────────────────── */

.file-info {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.file-info strong { color: var(--blue-cyan); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  letter-spacing: 0.2px;
}

.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn:not(:disabled):hover  { opacity: 0.88; }
.btn:not(:disabled):active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  color: #fff;
  box-shadow: 0 2px 10px rgba(25, 118, 210, 0.3);
}

.btn-action {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid));
  color: #fff;
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 1rem;
  padding: 0.85rem;
  box-shadow: 0 4px 16px rgba(13, 71, 161, 0.5);
  border-radius: var(--radius);
}

.btn-action:not(:disabled):hover {
  box-shadow: 0 4px 24px rgba(25, 118, 210, 0.55);
}

/* ── Progress ────────────────────────────────────────────────────────────── */

.progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.spinner {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Result box ──────────────────────────────────────────────────────────── */

.result-box {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.result-box.hidden { display: none; }

.result-header {
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.result-header.success {
  background: linear-gradient(90deg, rgba(27,94,32,0.4) 0%, rgba(27,94,32,0.1) 100%);
  color: var(--success-text);
  border-bottom: 1px solid rgba(105, 240, 174, 0.15);
}
.result-header.error {
  background: linear-gradient(90deg, rgba(183,28,28,0.4) 0%, rgba(183,28,28,0.1) 100%);
  color: var(--danger-text);
  border-bottom: 1px solid rgba(255,138,128,0.15);
}
.result-header.info {
  background: linear-gradient(90deg, rgba(13,71,161,0.4) 0%, rgba(13,71,161,0.1) 100%);
  color: var(--blue-cyan);
  border-bottom: 1px solid var(--border);
}
.result-header.warn {
  background: linear-gradient(90deg, rgba(230,81,0,0.35) 0%, rgba(230,81,0,0.08) 100%);
  color: var(--warn-text);
  border-bottom: 1px solid rgba(255,204,2,0.15);
}

.result-body {
  padding: 1.2rem;
  background: var(--surface);
  font-size: 0.86rem;
}

/* ── Certificate card ────────────────────────────────────────────────────── */

.cert-card {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.cert-card:hover {
  border-color: var(--blue-light);
  box-shadow: 0 0 16px rgba(66, 165, 245, 0.2);
  transform: translateY(-1px);
}

.cert-card h4 { font-size: 0.9rem; color: var(--text); margin-bottom: 0.35rem; }
.cert-card p  { font-size: 0.77rem; color: var(--muted); margin-bottom: 0.12rem; }

/* ── Hash display ────────────────────────────────────────────────────────── */

.hash-row {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin: 0.65rem 0;
}

.hash-label {
  font-size: 0.72rem;
  color: var(--metal-mid);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.hash-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.73rem;
  color: var(--blue-light);
  word-break: break-all;
  background: var(--surface3);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.tx-link {
  font-family: monospace;
  font-size: 0.73rem;
  color: var(--blue-cyan);
  word-break: break-all;
}

.meta-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.35rem 0.8rem;
  font-size: 0.84rem;
  margin: 0.8rem 0;
}

.meta-key   { color: var(--muted); }
.meta-value { color: var(--text); font-weight: 500; word-break: break-all; }

/* ── Divider ─────────────────────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 1.4rem 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  background: #050a14;
}

footer .footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

footer img {
  height: 22px;
  filter: grayscale(0.3) brightness(0.85);
}

footer .footer-brand {
  font-weight: 700;
  color: var(--blue-light);
  font-size: 0.88rem;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.mt-1   { margin-top: 0.5rem; }
.mt-2   { margin-top: 1rem; }
.note   { font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.5; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-mid); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .tab { font-size: 0.76rem; padding: 0.5rem 0.4rem; }
  .meta-grid { grid-template-columns: 1fr; }
  .header-logo img { height: 48px; }
  .logo-text-fallback { font-size: 1.9rem; }
}
