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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f7;
  color: #1f2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── HEADER ─────────────────────────────────── */
.app-header {
  background: #184195;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.header-sub {
  font-size: 11px;
  color: #b8d4f0;
  margin-top: 1px;
}

.header-company {
  font-size: 13px;
  color: #b8d4f0;
}

/* ─── MAIN ───────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 36px 24px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* ─── PAGE HEADING ───────────────────────────── */
.page-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.page-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #665ec7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.page-icon svg {
  width: 22px;
  height: 22px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

/* ─── CARD ───────────────────────────────────── */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.05);
  padding: 36px 40px;
}

.card-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 28px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 20px;
}

/* ─── STATE VIEWS ────────────────────────────── */
#view-input,
#view-loading,
#view-result,
#view-error {
  display: none;
}

#view-input.active,
#view-loading.active,
#view-result.active,
#view-error.active {
  display: block;
}

/* ─── INPUT VIEW ─────────────────────────────── */
.input-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
  text-align: center;
}

.input-icon-wrap {
  width: 52px;
  height: 52px;
  background: #e5e7eb;
  color: #374151;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.input-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.input-desc {
  font-size: 14px;
  color: #6b7280;
  max-width: 380px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.input-group {
  width: 100%;
  max-width: 380px;
  text-align: left;
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.folio-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  color: #111827;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}

.folio-input:focus {
  border-color: #004194;
  box-shadow: 0 0 0 3px rgba(0, 65, 148, 0.1);
}

.folio-input.error {
  border-color: #ef4444;
}

.input-hint {
  font-size: 12px;
  color: #ef4444;
  margin-top: 6px;
  min-height: 18px;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  padding: 13px 24px;
  background: #184195;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.btn-primary:hover {
  background: #1a3a7a;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 24px;
  background: #f3f4f6;
  color: #374151;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  margin-top: 4px;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-secondary svg {
  width: 16px;
  height: 16px;
}

/* ─── LOADING ────────────────────────────────── */
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e5e7eb;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 16px auto 20px;
}

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

.loading-text {
  text-align: center;
  color: #6b7280;
  font-size: 15px;
  padding-bottom: 8px;
}

/* ─── STATUS BANNER ──────────────────────────── */
.status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 28px;
}

.status-banner.valid {
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
}

.status-banner.invalid {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
}

.status-icon {
  font-size: 26px;
  line-height: 1;
}

.status-label {
  font-size: 16px;
  font-weight: 700;
}

.status-banner.valid .status-label { color: #065f46; }
.status-banner.invalid .status-label { color: #991b1b; }

.status-desc {
  font-size: 13px;
  margin-top: 3px;
}

.status-banner.valid .status-desc { color: #047857; }
.status-banner.invalid .status-desc { color: #b91c1c; }

/* ─── DATA GRID ──────────────────────────────── */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}

.data-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.data-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.data-value {
  font-size: 15px;
  color: #111827;
  font-weight: 500;
}

/* ─── DIVIDER ────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid #f3f4f6;
  margin: 24px 0;
}

/* ─── CRYPTO CHECKS ──────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  padding: 12px 16px;
}

.check-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.check-badge.ok {
  background: #d1fae5;
  color: #065f46;
}

.check-badge.err {
  background: #fee2e2;
  color: #991b1b;
}

/* ─── ERROR ──────────────────────────────────── */
.error-icon {
  width: 56px;
  height: 56px;
  background: #fef3c7;
  color: #b45309;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 20px;
}

.error-icon svg {
  width: 28px;
  height: 28px;
}

.error-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #111827;
  margin-bottom: 10px;
}

.error-msg {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
  line-height: 1.6;
}

/* ─── FOOTER ─────────────────────────────────── */
.app-footer {
  background: #184195;
  color: #b8d4f0;
  font-size: 12px;
  text-align: center;
  padding: 16px 24px;
  flex-shrink: 0;
}

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 520px) {
  .app-header {
    padding: 0 16px;
  }

  .header-company {
    display: none;
  }

  .main-content {
    padding: 24px 16px;
  }

  .card {
    padding: 24px 20px;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }
}
