/* ─── Reset & base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b0d14;
  --surface:   #111520;
  --surface2:  #181d2e;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --text:      #e8eaf2;
  --text-muted:#8b93b0;
  --accent:    #6c8fe8;
  --accent2:   #9b5de5;
  --green:     #39d98a;
  --yellow:    #f4b942;
  --red:       #f25f5c;
  --radius:    14px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Background orbs ─────────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
  animation: float 12s ease-in-out infinite alternate;
}
.orb-1 { width: 600px; height: 600px; background: #4f6ef7; top: -200px; left: -150px; animation-delay: 0s; }
.orb-2 { width: 500px; height: 500px; background: #9b5de5; bottom: -150px; right: -100px; animation-delay: -4s; }
.orb-3 { width: 350px; height: 350px; background: #39d98a; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -8s; }
@keyframes float { from { transform: translate(0,0) scale(1); } to { transform: translate(30px,20px) scale(1.05); } }

/* ─── Header ──────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,13,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #4f6ef7, #9b5de5);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.logo-title { display: block; font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }
.logo-sub { display: block; font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }
.header-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Badges ──────────────────────────────────────────── */
.badge {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; letter-spacing: 0.4px;
}
.badge-blue   { background: rgba(108,143,232,0.18); color: #8aabf5; border: 1px solid rgba(108,143,232,0.3); }
.badge-purple { background: rgba(155,93,229,0.18);  color: #c399f5; border: 1px solid rgba(155,93,229,0.3); }
.badge-green  { background: rgba(57,217,138,0.15);  color: #5edf9e; border: 1px solid rgba(57,217,138,0.3); }
.badge-yellow { background: rgba(244,185,66,0.15);  color: #f4c96b; border: 1px solid rgba(244,185,66,0.3); }
.badge-red    { background: rgba(242,95,92,0.15);   color: #f58280; border: 1px solid rgba(242,95,92,0.3); }
.badge-lg { font-size: 13px; padding: 5px 13px; }

/* ─── Main layout ─────────────────────────────────────── */
.main { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 48px 24px 80px; }

/* ─── Hero ────────────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 40px; }
.hero-title {
  font-size: clamp(26px, 4vw, 38px); font-weight: 700;
  letter-spacing: -1px; line-height: 1.2;
  background: linear-gradient(135deg, #e8eaf2 30%, #6c8fe8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 12px;
}
.hero-subtitle { color: var(--text-muted); font-size: 15px; max-width: 520px; margin: 0 auto; }
.hero-subtitle strong { color: #8aabf5; font-weight: 600; }

/* ─── Input card ──────────────────────────────────────── */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 40px rgba(0,0,0,0.4);
  margin-bottom: 32px;
}
.input-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.input-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.input-actions { display: flex; gap: 8px; }

.credential-textarea {
  width: 100%; min-height: 160px; resize: vertical;
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; line-height: 1.7; padding: 18px;
  word-break: break-all;
}
.credential-textarea::placeholder { color: #3d4566; }

.input-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.format-hint { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ─── Buttons ─────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #4f6ef7, #9b5de5);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s, transform 0.15s;
  font-family: 'Inter', sans-serif;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 12px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: var(--text); border-color: var(--border2); }
.btn-ghost.small { font-size: 11px; padding: 4px 10px; }

/* ─── Output section ──────────────────────────────────── */
.output-section { animation: slideUp 0.35s ease; }
@keyframes slideUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

.output-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

/* ─── Tabs ────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.tab {
  flex: 1; padding: 7px 12px; text-align: center;
  background: transparent; border: none; border-radius: 7px;
  color: var(--text-muted); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.tab.active {
  background: linear-gradient(135deg, rgba(79,110,247,0.25), rgba(155,93,229,0.25));
  color: #c0d0ff;
  border: 1px solid rgba(108,143,232,0.3);
}

.tab-panel.hidden { display: none; }

/* ─── Data table ──────────────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.data-table th, .data-table td {
  padding: 11px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: rgba(255,255,255,0.03);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-muted); width: 35%;
}
.data-table td { font-size: 13px; color: var(--text); word-break: break-word; }
.data-table tr:last-child td, .data-table tr:last-child th { border-bottom: none; }
.data-table tr:hover td, .data-table tr:hover th { background: rgba(255,255,255,0.02); }

.cell-mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.cell-muted { color: var(--text-muted); font-style: italic; }

/* ─── Section header inside panels ───────────────────── */
.panel-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--accent); margin: 20px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid rgba(108,143,232,0.2);
}

/* ─── Photo panel ─────────────────────────────────────── */
.photo-panel { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.photo-img {
  width: 160px; height: 200px; object-fit: cover;
  border-radius: 10px; border: 2px solid var(--border2);
  background: var(--surface2);
}
.photo-placeholder {
  width: 160px; height: 200px; border-radius: 10px;
  border: 2px dashed var(--border2); background: var(--surface2);
  display: grid; place-items: center; color: var(--text-muted); font-size: 13px;
}
.photo-meta { flex: 1; }

/* ─── Raw JSON panel ──────────────────────────────────── */
.raw-json {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: #9bb3ff; line-height: 1.7; overflow-x: auto;
  max-height: 600px; overflow-y: auto;
  white-space: pre;
}

/* ─── Error ───────────────────────────────────────────── */
.error-section {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(242,95,92,0.08); border: 1px solid rgba(242,95,92,0.25);
  border-radius: var(--radius); padding: 20px;
  animation: slideUp 0.3s ease;
}
.error-icon { color: var(--red); margin-top: 2px; flex-shrink: 0; }
.error-title { font-weight: 700; color: var(--red); margin-bottom: 4px; }
.error-message { font-size: 13px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ─── Footer ──────────────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  text-align: center; padding: 28px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; line-height: 2;
}

/* ─── Utilities ───────────────────────────────────────── */
.hidden { display: none !important; }
